[clutter/clutter-1.8] click-action: Be resilient against NULL pointers



commit eaf64d18e7d4ab9bd889440fd94f66783dd49280
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Jan 12 10:26:47 2012 +0000

    click-action: Be resilient against NULL pointers
    
    Do not try to disconnect signal handlers from NULL pointers.
    (cherry picked from commit dbf3b607bf1b295c782ab8edfb2d80bc25f74a37)
    
    Signed-off-by: Emmanuele Bassi <ebassi linux intel com>

 clutter/clutter-click-action.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/clutter/clutter-click-action.c b/clutter/clutter-click-action.c
index a124634..8f0844e 100644
--- a/clutter/clutter-click-action.c
+++ b/clutter/clutter-click-action.c
@@ -433,13 +433,17 @@ clutter_click_action_set_actor (ClutterActorMeta *meta,
     {
       ClutterActor *old_actor = clutter_actor_meta_get_actor (meta);
 
-      g_signal_handler_disconnect (old_actor, priv->event_id);
+      if (old_actor != NULL)
+        g_signal_handler_disconnect (old_actor, priv->event_id);
+
       priv->event_id = 0;
     }
 
   if (priv->capture_id != 0)
     {
-      g_signal_handler_disconnect (priv->stage, priv->capture_id);
+      if (priv->stage != NULL)
+        g_signal_handler_disconnect (priv->stage, priv->capture_id);
+
       priv->capture_id = 0;
       priv->stage = NULL;
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]