mirror of
https://github.com/brl/mutter.git
synced 2024-11-13 01:36:10 -05:00
actor: Make set_flags() safe from unrefs
It's possible - though not recommended - that user code causes the destruction of an actor in one of the notification handlers for flag-based properties. We should protect the multiple notification emission with g_object_ref/unref.
This commit is contained in:
parent
6f737a5f5a
commit
0736cb7323
@ -10368,6 +10368,7 @@ clutter_actor_set_flags (ClutterActor *self,
|
||||
return;
|
||||
|
||||
obj = G_OBJECT (self);
|
||||
g_object_ref (obj);
|
||||
g_object_freeze_notify (obj);
|
||||
|
||||
old_flags = self->flags;
|
||||
@ -10397,6 +10398,7 @@ clutter_actor_set_flags (ClutterActor *self,
|
||||
g_object_notify (obj, "visible");
|
||||
|
||||
g_object_thaw_notify (obj);
|
||||
g_object_unref (obj);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user