click-action: Be resilient against NULL pointers

Do not try to disconnect signal handlers from NULL pointers.
This commit is contained in:
Emmanuele Bassi 2012-01-12 10:26:47 +00:00
parent 8e6b3914ef
commit dbf3b607bf

View File

@ -433,13 +433,17 @@ clutter_click_action_set_actor (ClutterActorMeta *meta,
{
ClutterActor *old_actor = clutter_actor_meta_get_actor (meta);
g_signal_handler_disconnect (old_actor, priv->event_id);
if (old_actor != NULL)
g_signal_handler_disconnect (old_actor, priv->event_id);
priv->event_id = 0;
}
if (priv->capture_id != 0)
{
g_signal_handler_disconnect (priv->stage, priv->capture_id);
if (priv->stage != NULL)
g_signal_handler_disconnect (priv->stage, priv->capture_id);
priv->capture_id = 0;
priv->stage = NULL;
}