diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2013-06-12 15:50:37 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2013-06-12 15:50:37 +0000 |
commit | 51b02ed94d779d5b11cb8bee5ae5fb0c137e23e0 (patch) | |
tree | 7f62bba72bf8ef18a354df53c1ccf41600956a6f /ui/gtk/flow_graph.c | |
parent | aa9080b7353972518968ead12ba9c9459bfa2350 (diff) |
From Peter Hatina via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8793 :
Fix crash if you cancel the Flow Graph window while the Graph Analysis window
is still open: close the Graph Analysis window when the user cancels the Flow
Graph window.
From me: do the same thing for the window-delete case.
svn path=/trunk/; revision=49908
Diffstat (limited to 'ui/gtk/flow_graph.c')
-rw-r--r-- | ui/gtk/flow_graph.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/ui/gtk/flow_graph.c b/ui/gtk/flow_graph.c index 781f402968..c5d33bc0ae 100644 --- a/ui/gtk/flow_graph.c +++ b/ui/gtk/flow_graph.c @@ -459,6 +459,25 @@ flow_graph_on_ok(GtkButton *button _U_, } } +static void +flow_graph_on_cancel(GtkButton *button _U_, + gpointer user_data) +{ + if (graph_analysis_data->dlg.window) { + window_destroy(graph_analysis_data->dlg.window); + } + window_destroy(GTK_WIDGET(user_data)); +} + +static gboolean +flow_graph_on_delete(GtkButton *button _U_, + gpointer user_data _U_) +{ + if (graph_analysis_data->dlg.window) { + window_destroy(graph_analysis_data->dlg.window); + } + return FALSE; +} /****************************************************************************/ /* INTERFACE */ @@ -606,9 +625,9 @@ flow_graph_dlg_create(void) gtk_box_pack_start(GTK_BOX(hbuttonbox), bt_cancel, TRUE, TRUE, 0); gtk_widget_set_can_default(bt_cancel, TRUE); gtk_widget_set_tooltip_text (bt_cancel, "Cancel this dialog"); - window_set_cancel_button(flow_graph_dlg_w, bt_cancel, window_cancel_button_cb); + g_signal_connect(bt_cancel, "clicked", G_CALLBACK(flow_graph_on_cancel), flow_graph_dlg_w); - g_signal_connect(flow_graph_dlg_w, "delete_event", G_CALLBACK(window_delete_event_cb), NULL); + g_signal_connect(flow_graph_dlg_w, "delete_event", G_CALLBACK(flow_graph_on_delete), NULL); g_signal_connect(flow_graph_dlg_w, "destroy", G_CALLBACK(flow_graph_on_destroy), NULL); gtk_widget_show_all(flow_graph_dlg_w); |