ClutterDropAction: Avoid accessing priv->stage is not yet resolved.
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Thu, 17 May 2012 22:08:57 +0000 (18:08 -0400)
committerEmmanuele Bassi <ebassi@gnome.org>
Mon, 21 May 2012 07:43:17 +0000 (08:43 +0100)
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

index 4fec019..8c4def2 100644 (file)
@@ -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;