[clutter] ClutterDropAction: Avoid accessing priv->stage is not yet resolved.



commit dd61be7c2ea238432524dea16b04baf424c2cd36
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Thu May 17 18:08:57 2012 -0400

    ClutterDropAction: Avoid accessing priv->stage is not yet resolved.
    
    This fixes drop_action_unregister() to not call g_object_get_data()
    on priv->stage if not yet resolved. This can happen if the action's
    actor was destroyed before ever being mapped.

 clutter/clutter-drop-action.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/clutter/clutter-drop-action.c b/clutter/clutter-drop-action.c
index 4fec019..8c4def2 100644
--- a/clutter/clutter-drop-action.c
+++ b/clutter/clutter-drop-action.c
@@ -276,9 +276,11 @@ static void
 drop_action_unregister (ClutterDropAction *self)
 {
   ClutterDropActionPrivate *priv = self->priv;
-  DropTarget *data;
+  DropTarget *data = NULL;
+
+  if (priv->stage != NULL)
+    data = g_object_get_data (G_OBJECT (priv->stage), "__clutter_drop_targets");
 
-  data = g_object_get_data (G_OBJECT (priv->stage), "__clutter_drop_targets");
   if (data == NULL)
     return;
 



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