[ghex/gtk4-port: 87/91] Stop runtime warnings when quit w/ unsaved tabs




commit f8578dfbafc894d1862ee5c19e0602e8550f27be
Author: Logan Rathbone <poprocks gmail com>
Date:   Thu Aug 5 23:42:57 2021 -0400

    Stop runtime warnings when quit w/ unsaved tabs

 src/ghex-application-window.c |  4 +---
 src/ghex-notebook-tab.c       | 10 ++++------
 2 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/src/ghex-application-window.c b/src/ghex-application-window.c
index fc6011ae..0424deb4 100644
--- a/src/ghex-application-window.c
+++ b/src/ghex-application-window.c
@@ -298,8 +298,6 @@ ghex_application_window_remove_tab (GHexApplicationWindow *self,
         * for now for debugging purposes. */
        g_return_if_fail (g_list_find (self->gh_list, tab_gh));
        self->gh_list = g_list_remove (self->gh_list, tab_gh);
-
-       g_object_unref (tab);
 }
 
 static void
@@ -330,7 +328,7 @@ do_close_window (GHexApplicationWindow *self)
 {
        g_return_if_fail (GHEX_IS_APPLICATION_WINDOW (self));
        
-       g_object_unref (self);
+       gtk_window_set_application (GTK_WINDOW(self), NULL);
 }
 
 static void
diff --git a/src/ghex-notebook-tab.c b/src/ghex-notebook-tab.c
index 0a7560a9..8fa63d08 100644
--- a/src/ghex-notebook-tab.c
+++ b/src/ghex-notebook-tab.c
@@ -132,21 +132,19 @@ ghex_notebook_tab_dispose (GObject *object)
        /* Unparent children */
        g_clear_pointer (&self->label, gtk_widget_unparent);
        g_clear_pointer (&self->close_btn, gtk_widget_unparent);
-
-       /* Unref GtkHex widget associated with tab */
-       g_object_unref (self->gh);
+       g_clear_object (&self->gh);
 
        /* Boilerplate: chain up */
        G_OBJECT_CLASS(ghex_notebook_tab_parent_class)->dispose(object);
 }
 
 static void
-ghex_notebook_tab_finalize (GObject *gobject)
+ghex_notebook_tab_finalize (GObject *object)
 {
-       /* here, you would free stuff. I've got nuthin' for ya. */
+       GHexNotebookTab *self = GHEX_NOTEBOOK_TAB(object);
 
        /* Boilerplate: chain up */
-       G_OBJECT_CLASS(ghex_notebook_tab_parent_class)->finalize(gobject);
+       G_OBJECT_CLASS(ghex_notebook_tab_parent_class)->finalize(object);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]