Don't destroy MainWindow on delete-event, just hide it
authorDanielle Madeley <danielle.madeley@collabora.co.uk>
Tue, 20 Sep 2011 06:32:33 +0000 (16:32 +1000)
committerDanielle Madeley <danielle.madeley@collabora.co.uk>
Tue, 20 Sep 2011 06:32:33 +0000 (16:32 +1000)
This stops MainWindow being unreferenced, and prevents crashes caused by
things which then try to use it.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=659118

src/empathy-main-window.c

index 679f000..0e75b1c 100644 (file)
@@ -2122,6 +2122,10 @@ empathy_main_window_init (EmpathyMainWindow *window)
        gtk_window_set_role (GTK_WINDOW (window), "contact_list");
        gtk_window_set_default_size (GTK_WINDOW (window), 225, 325);
 
+       /* don't finalize the widget on delete-event, just hide it */
+       g_signal_connect (window, "delete-event",
+               G_CALLBACK (gtk_widget_hide_on_delete), NULL);
+
        /* Set up interface */
        filename = empathy_file_lookup ("empathy-main-window.ui", "src");
        gui = empathy_builder_get_file (filename,