ClutterDragAction: do not dereference a NULL priv->stage

When destroying an actor during a drag-action with a drag_handle, the
ClutterDragAction's priv->stage could be set to NULL in _set_actor().
_dispose() must not assume that priv->stage is not NULL.

See also https://bugzilla.gnome.org/show_bug.cgi?id=681814
This commit is contained in:
Alban Crequy 2013-04-29 14:59:20 +01:00
parent a0d9eaf15d
commit 2be42c333a

View File

@ -657,6 +657,8 @@ clutter_drag_action_dispose (GObject *gobject)
/* if we're being disposed while a capture is still present, we
* need to reset the state we are currently holding
*/
if (priv->stage != NULL)
{
if (priv->last_motion_device != NULL)
{
_clutter_stage_remove_pointer_drag_actor (priv->stage,
@ -676,12 +678,18 @@ clutter_drag_action_dispose (GObject *gobject)
clutter_stage_set_motion_events_enabled (priv->stage,
priv->motion_events_enabled);
if (priv->stage != NULL)
g_signal_handler_disconnect (priv->stage, priv->capture_id);
priv->capture_id = 0;
priv->stage = NULL;
}
}
else
{
priv->last_motion_device = NULL;
priv->sequence = NULL;
priv->capture_id = 0;
}
if (priv->button_press_id != 0)
{