summarylogtreecommitdiffstats
path: root/crack-attack-1.1.14-rhbz1065649.patch
blob: 318016a1f3452adb372ffb0f1cd51dfbe071b5f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- crack-attack-1.1.14/src/gtk-gui/gui_main.cxx~	2005-05-13 21:55:24.000000000 +0200
+++ crack-attack-1.1.14/src/gtk-gui/gui_main.cxx	2014-06-14 10:24:32.738154080 +0200
@@ -50,6 +50,18 @@
 int glut_argc;
 char **glut_argv;
 
+/* 
+ * Call this when the window is unexpectedly destroyed to make sure the
+ * hidden gui process doesn't hang around in the background.
+ */
+static void destroy_window(GtkObject *object, gpointer data) {
+#ifdef DEVELOPMENT
+	g_print("\nOh no! We've been nexpectedly destroyed! :(\n");
+#endif
+	gtk_main_quit();
+}
+
+
 /*
  * Documentation
  *   html tables don't work right in explorer
@@ -76,6 +88,8 @@
     winCrackAttackSplash = create_winCrackAttackSplash ();
 		gui_data_read(winCrackAttackSplash);
     gtk_widget_show (winCrackAttackSplash);
+		g_signal_connect(GTK_OBJECT(winCrackAttackSplash), "destroy",
+				G_CALLBACK(destroy_window), NULL);
     gtk_main ();
 
   return 0;