From 911518d683efe6e5aee29dab932e8d17b9339317 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 29 Nov 2013 14:08:00 +0100 Subject: [PATCH] wacom: Don't leave stray timelines on the calibration UI Keep the reference for the error/helper messages animations in the CalibArea struct, so those are destroyed and not leaked, or possibly crashing when running on already destroyed actors if the dialog gets cancelled at the right time. https://bugzilla.gnome.org/show_bug.cgi?id=719698 --- panels/wacom/calibrator/calibrator-gui.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/panels/wacom/calibrator/calibrator-gui.c b/panels/wacom/calibrator/calibrator-gui.c index e67795bc2..4324b0735 100644 --- a/panels/wacom/calibrator/calibrator-gui.c +++ b/panels/wacom/calibrator/calibrator-gui.c @@ -59,6 +59,8 @@ struct CalibArea ClutterActor *helper_text_body; ClutterActor *error_text; ClutterTransition *clock_timeline; + ClutterTransition *error_msg_timeline; + ClutterTransition *helper_msg_timeline; GdkPixbuf *icon_success; FinishCallback callback; @@ -153,6 +155,11 @@ on_delete_event (GtkWidget *widget, { clutter_timeline_stop (CLUTTER_TIMELINE (area->clock_timeline)); + if (area->error_msg_timeline) + clutter_timeline_stop (CLUTTER_TIMELINE (area->error_msg_timeline)); + if (area->helper_msg_timeline) + clutter_timeline_stop (CLUTTER_TIMELINE (area->helper_msg_timeline)); + gtk_widget_hide (area->window); (*area->callback) (area, area->user_data); @@ -267,6 +274,9 @@ show_error_message (CalibArea *area) clutter_actor_show (area->error_text); transition = get_error_message_transition (area); clutter_timeline_start (CLUTTER_TIMELINE (transition)); + + g_clear_object (&area->error_msg_timeline); + area->error_msg_timeline = transition; } static void @@ -288,6 +298,9 @@ hide_error_message (CalibArea *area) G_CALLBACK (on_error_message_transparent), area); clutter_timeline_start (CLUTTER_TIMELINE (transition)); + + g_clear_object (&area->error_msg_timeline); + area->error_msg_timeline = transition; } static gboolean @@ -413,6 +426,9 @@ show_helper_text_body (CalibArea *area) clutter_transition_set_from (transition, G_TYPE_FLOAT, -height); clutter_transition_set_to (transition, G_TYPE_FLOAT, 0.0); clutter_timeline_start (CLUTTER_TIMELINE (transition)); + + g_clear_object (&area->helper_msg_timeline); + area->helper_msg_timeline = transition; } static void @@ -448,6 +464,9 @@ show_helper_text_title (CalibArea *area) area); clutter_timeline_start (CLUTTER_TIMELINE (transition)); + + g_clear_object (&area->helper_msg_timeline); + area->helper_msg_timeline = transition; } static void @@ -779,7 +798,9 @@ calib_area_free (CalibArea *area) g_return_if_fail (area != NULL); g_clear_object (&area->icon_success); - + g_clear_object (&area->clock_timeline); + g_clear_object (&area->error_msg_timeline); + g_clear_object (&area->helper_msg_timeline); gtk_widget_destroy (area->window); g_free (area); }