Blame wireshark-1.8.x-flow-graph-crash.patch

Peter Hatina 1a225d
diff --git a/ui/gtk/flow_graph.c b/ui/gtk/flow_graph.c
Peter Hatina 1a225d
index f380e62..dd92027 100644
Peter Hatina 1a225d
--- a/ui/gtk/flow_graph.c
Peter Hatina 1a225d
+++ b/ui/gtk/flow_graph.c
Peter Hatina 1a225d
@@ -460,6 +460,25 @@ flow_graph_on_ok(GtkButton       *button _U_,
Peter Hatina 1a225d
 	}
Peter Hatina 1a225d
 }
Peter Hatina 1a225d
 
Peter Hatina 1a225d
+static void
Peter Hatina 1a225d
+flow_graph_on_cancel(GtkButton       *button _U_,
Peter Hatina 1a225d
+		     gpointer         user_data)
Peter Hatina 1a225d
+{
Peter Hatina 1a225d
+	if (graph_analysis_data->dlg.window) {
Peter Hatina 1a225d
+		window_destroy(graph_analysis_data->dlg.window);
Peter Hatina 1a225d
+	}
Peter Hatina 1a225d
+	window_destroy(GTK_WIDGET(user_data));
Peter Hatina 1a225d
+}
Peter Hatina 1a225d
+
Peter Hatina 1a225d
+static gboolean
Peter Hatina 1a225d
+flow_graph_on_delete(GtkButton       *button _U_,
Peter Hatina 1a225d
+		     gpointer         user_data _U_)
Peter Hatina 1a225d
+{
Peter Hatina 1a225d
+	if (graph_analysis_data->dlg.window) {
Peter Hatina 1a225d
+		window_destroy(graph_analysis_data->dlg.window);
Peter Hatina 1a225d
+	}
Peter Hatina 1a225d
+	return FALSE;
Peter Hatina 1a225d
+}
Peter Hatina 1a225d
 
Peter Hatina 1a225d
 /****************************************************************************/
Peter Hatina 1a225d
 /* INTERFACE                                                                */
Peter Hatina 1a225d
@@ -607,9 +626,9 @@ flow_graph_dlg_create(void)
Peter Hatina 1a225d
 	gtk_box_pack_start(GTK_BOX(hbuttonbox), bt_cancel, TRUE, TRUE, 0);
Peter Hatina 1a225d
 	gtk_widget_set_can_default(bt_cancel, TRUE);
Peter Hatina 1a225d
 	gtk_widget_set_tooltip_text (bt_cancel, "Cancel this dialog");
Peter Hatina 1a225d
-	window_set_cancel_button(flow_graph_dlg_w, bt_cancel, window_cancel_button_cb);
Peter Hatina 1a225d
+	g_signal_connect(bt_cancel, "clicked", G_CALLBACK(flow_graph_on_cancel), flow_graph_dlg_w);
Peter Hatina 1a225d
 
Peter Hatina 1a225d
-	g_signal_connect(flow_graph_dlg_w, "delete_event", G_CALLBACK(window_delete_event_cb), NULL);
Peter Hatina 1a225d
+	g_signal_connect(flow_graph_dlg_w, "delete_event", G_CALLBACK(flow_graph_on_delete), NULL);
Peter Hatina 1a225d
 	g_signal_connect(flow_graph_dlg_w, "destroy", G_CALLBACK(flow_graph_on_destroy), NULL);
Peter Hatina 1a225d
 
Peter Hatina 1a225d
 	gtk_widget_show_all(flow_graph_dlg_w);