diff options
author | Artem Egorkine <ext-artem.egorkine@nokia.com> | 2009-05-13 17:58:32 +0300 |
---|---|---|
committer | Claudio Saavedra <csaavedra@igalia.com> | 2009-05-13 17:58:32 +0300 |
commit | 081db0c35ad74d3d1472345cd87843708b64b8cb (patch) | |
tree | 1172014be480b007b1d7bbcfd027377d7c5d3da4 | |
parent | 49ef2e563975a0452ececf42d255033a87e63402 (diff) |
Clean up signal handlers in animation actor and remote texture
* src/hildon-animation-actor.c,
* src/hildon-remote-texture.c:
Added proper object cleanup to remove signal handler and object
references as HildonAnimationActor and HildonRemoteTexture
objects get destroyed.
Fixes: NB#116682 (Destroying parented animation actors when
parent in unmapped leads to crash)
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | hildon/hildon-animation-actor.c | 20 | ||||
-rw-r--r-- | hildon/hildon-remote-texture.c | 20 |
3 files changed, 51 insertions, 0 deletions
@@ -1,3 +1,14 @@ +2009-05-13 Artem Egorkine <ext-artem.egorkine@nokia.com> + + * src/hildon-animation-actor.c, + * src/hildon-remote-texture.c: + Added proper object cleanup to remove signal handler and object + references as HildonAnimationActor and HildonRemoteTexture + objects get destroyed. + + Fixes: NB#116682 (Destroying parented animation actors when + parent in unmapped leads to crash) + 2009-05-13 Claudio Saavedra <csaavedra@igalia.com> Based on a patch by Christian Dywan (christian@imendio.com) diff --git a/hildon/hildon-animation-actor.c b/hildon/hildon-animation-actor.c index 0d623d8..b826ffb 100644 --- a/hildon/hildon-animation-actor.c +++ b/hildon/hildon-animation-actor.c @@ -277,10 +277,30 @@ hildon_animation_actor_hide (GtkWidget *widget) } static void +hildon_animation_actor_finalize (GObject *object) +{ + HildonAnimationActor *self = HILDON_ANIMATION_ACTOR (object); + HildonAnimationActorPrivate + *priv = HILDON_ANIMATION_ACTOR_GET_PRIVATE (self); + + if (priv->parent) + { + if (priv->parent_map_event_cb_id) + g_signal_handler_disconnect (priv->parent, + priv->parent_map_event_cb_id); + + g_object_unref (priv->parent); + } +} + +static void hildon_animation_actor_class_init (HildonAnimationActorClass *klass) { + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + gobject_class->finalize = hildon_animation_actor_finalize; + widget_class->realize = hildon_animation_actor_realize; widget_class->unrealize = hildon_animation_actor_unrealize; widget_class->show = hildon_animation_actor_show; diff --git a/hildon/hildon-remote-texture.c b/hildon/hildon-remote-texture.c index f8bbbd7..8440158 100644 --- a/hildon/hildon-remote-texture.c +++ b/hildon/hildon-remote-texture.c @@ -169,10 +169,30 @@ hildon_remote_texture_hide (GtkWidget *widget) } static void +hildon_remote_texture_finalize (GObject *object) +{ + HildonRemoteTexture *self = HILDON_REMOTE_TEXTURE (object); + HildonRemoteTexturePrivate + *priv = HILDON_REMOTE_TEXTURE_GET_PRIVATE (self); + + if (priv->parent) + { + if (priv->parent_map_event_cb_id) + g_signal_handler_disconnect (priv->parent, + priv->parent_map_event_cb_id); + + g_object_unref (priv->parent); + } +} + +static void hildon_remote_texture_class_init (HildonRemoteTextureClass *klass) { + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + gobject_class->finalize = hildon_remote_texture_finalize; + widget_class->realize = hildon_remote_texture_realize; widget_class->unrealize = hildon_remote_texture_unrealize; widget_class->show = hildon_remote_texture_show; |