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:
Emmanuele Bassi 2010-07-29 17:00:24 +01:00
parent 6f737a5f5a
commit 0736cb7323

View File

@ -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);
}
/**