From a0d9eaf15da5d2227bc95c6946fca5ed356fdfdb Mon Sep 17 00:00:00 2001 From: Alban Crequy Date: Fri, 26 Apr 2013 15:26:48 +0100 Subject: [PATCH] fix crash when destroying an actor during a drag-action with a drag_handle Bug introduced by commit 59801ef8 (drag-action: fix press coords transform with drag_handle) for bgo#681746. See also https://bugzilla.gnome.org/show_bug.cgi?id=681814 --- clutter/clutter-drag-action.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/clutter/clutter-drag-action.c b/clutter/clutter-drag-action.c index ef2ab0dc2..7e1a60009 100644 --- a/clutter/clutter-drag-action.c +++ b/clutter/clutter-drag-action.c @@ -1139,16 +1139,19 @@ clutter_drag_action_set_drag_handle (ClutterDragAction *action, priv->drag_handle = handle; - priv->transformed_press_x = priv->press_x; - priv->transformed_press_y = priv->press_y; - clutter_actor_transform_stage_point (handle, priv->press_x, priv->press_y, - &priv->transformed_press_x, - &priv->transformed_press_y); - if (priv->drag_handle != NULL) - g_signal_connect (priv->drag_handle, "destroy", - G_CALLBACK (on_drag_handle_destroy), - action); + { + priv->transformed_press_x = priv->press_x; + priv->transformed_press_y = priv->press_y; + clutter_actor_transform_stage_point (priv->drag_handle, priv->press_x, + priv->press_y, + &priv->transformed_press_x, + &priv->transformed_press_y); + + g_signal_connect (priv->drag_handle, "destroy", + G_CALLBACK (on_drag_handle_destroy), + action); + } g_object_notify_by_pspec (G_OBJECT (action), drag_props[PROP_DRAG_HANDLE]); }