diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2015-03-16 13:57:03 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2015-03-16 16:29:37 +0100 |
commit | 70e7b4c8480f9cfc351291bc7f12147690f7ff49 (patch) | |
tree | b255bcd41e788a3412729df7773f9b84cbda8e86 | |
parent | b4b23580a61bd9694e178a1a6b16bcb783fd9013 (diff) | |
download | gtk+-70e7b4c8480f9cfc351291bc7f12147690f7ff49.tar.gz |
inspector: Remove flash timeout from widgets being unmapped
Otherwise the timeout can keep running, even if the widget is being
destroyed.
-rw-r--r-- | gtk/inspector/inspect-button.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/inspector/inspect-button.c b/gtk/inspector/inspect-button.c index 55d92da82f..937e006870 100644 --- a/gtk/inspector/inspect-button.c +++ b/gtk/inspector/inspect-button.c @@ -191,6 +191,7 @@ clear_flash (GtkInspectorWindow *iw) { gtk_widget_queue_draw (iw->flash_widget); g_signal_handlers_disconnect_by_func (iw->flash_widget, draw_flash, iw); + g_signal_handlers_disconnect_by_func (iw->flash_widget, clear_flash, iw); iw->flash_widget = NULL; } } @@ -204,6 +205,7 @@ start_flash (GtkInspectorWindow *iw, iw->flash_count = 1; iw->flash_widget = widget; g_signal_connect_after (widget, "draw", G_CALLBACK (draw_flash), iw); + g_signal_connect_swapped (widget, "unmap", G_CALLBACK (clear_flash), iw); gtk_widget_queue_draw (widget); } @@ -434,6 +436,7 @@ on_flash_timeout (GtkInspectorWindow *iw) if (iw->flash_count == 6) { g_signal_handlers_disconnect_by_func (iw->flash_widget, draw_flash, iw); + g_signal_handlers_disconnect_by_func (iw->flash_widget, clear_flash, iw); iw->flash_widget = NULL; iw->flash_cnx = 0; @@ -471,6 +474,7 @@ void gtk_inspector_stop_highlight (GtkWidget *widget) { g_signal_handlers_disconnect_by_func (widget, draw_flash, NULL); + g_signal_handlers_disconnect_by_func (widget, clear_flash, NULL); gtk_widget_queue_draw (widget); } |