clutter/actor: Unref the root node if set as child
When setting the root node as child of a clip or transform node, we add a new reference to it, without removing the one that we've previously added when getting it from the actor node (and that won't ever be unset by the auto-pointer since the root_node is re-associated). So, once we add the root node as child and re-define it, unref it. Fixes https://gitlab.gnome.org/GNOME/mutter/issues/908
This commit is contained in:
parent
60800d2313
commit
f133de2dd4
@ -3934,6 +3934,7 @@ clutter_actor_paint (ClutterActor *self)
|
||||
clip_node = clutter_clip_node_new ();
|
||||
clutter_paint_node_add_rectangle (clip_node, &clip);
|
||||
clutter_paint_node_add_child (clip_node, root_node);
|
||||
clutter_paint_node_unref (root_node);
|
||||
|
||||
root_node = g_steal_pointer (&clip_node);
|
||||
}
|
||||
@ -3947,6 +3948,7 @@ clutter_actor_paint (ClutterActor *self)
|
||||
|
||||
transform_node = clutter_transform_node_new (&transform);
|
||||
clutter_paint_node_add_child (transform_node, root_node);
|
||||
clutter_paint_node_unref (root_node);
|
||||
|
||||
root_node = g_steal_pointer (&transform_node);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user