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
This commit is contained in:
Alban Crequy 2013-04-26 15:26:48 +01:00
parent 5586b0deba
commit a0d9eaf15d

View File

@ -1139,16 +1139,19 @@ clutter_drag_action_set_drag_handle (ClutterDragAction *action,
priv->drag_handle = handle; 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) if (priv->drag_handle != NULL)
g_signal_connect (priv->drag_handle, "destroy", {
G_CALLBACK (on_drag_handle_destroy), priv->transformed_press_x = priv->press_x;
action); 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]); g_object_notify_by_pspec (G_OBJECT (action), drag_props[PROP_DRAG_HANDLE]);
} }