Fix bugs in closing gds render windows

This commit is contained in:
2019-03-15 20:36:23 +01:00
parent 28734a797a
commit 19b26a3c26
2 changed files with 17 additions and 13 deletions

View File

@@ -74,15 +74,10 @@ static gboolean on_window_close(gpointer window, GdkEvent *event, gpointer user)
if (!self)
return TRUE;
g_clear_object(&self->main_window);
g_clear_object(&self->cell_tree_view);
g_clear_object(&self->convert_button);
g_clear_object(&self->layer_selector);
g_clear_object(&self->cell_tree_store);
g_clear_object(&self->cell_search_entry);
/* Close Window. Leads to termination of the program/the current instance */
g_clear_object(&self->main_window);
gtk_widget_destroy(GTK_WIDGET(window));
return TRUE;
}
@@ -429,17 +424,19 @@ static void gds_render_gui_dispose(GObject *gobject)
self = RENDERER_GUI(gobject);
if (self->main_window) {
gtk_window_close(self->main_window);
}
g_clear_object(&self->main_window);
g_clear_object(&self->cell_tree_view);
g_clear_object(&self->convert_button);
g_clear_object(&self->layer_selector);
g_clear_object(&self->cell_tree_store);
g_clear_object(&self->cell_search_entry);
if (self->main_window) {
g_signal_handlers_destroy(self->main_window);
gtk_widget_destroy(GTK_WIDGET(self->main_window));
self->main_window = NULL;
}
/* Chain up */
G_OBJECT_CLASS(gds_render_gui_parent_class)->dispose(gobject);
}