[file-roller/wip/jtojnar/gobject-modernization: 4/12] window: Use G_DEFINE_TYPE_WITH_PRIVATE




commit 63b5cd4573b360974b462eecff88a97da8db3a03
Author: Jan Tojnar <jtojnar gmail com>
Date:   Fri Aug 5 20:58:54 2022 +0200

    window: Use G_DEFINE_TYPE_WITH_PRIVATE

 src/fr-window.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/fr-window.c b/src/fr-window.c
index 6d0f6ee5..afd99ba2 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -211,10 +211,6 @@ fr_clipboard_data_set_password (FrClipboardData *clipboard_data,
 
 /**/
 
-
-G_DEFINE_TYPE (FrWindow, fr_window, GTK_TYPE_APPLICATION_WINDOW)
-
-
 enum {
        ARCHIVE_LOADED,
        PROGRESS,
@@ -378,6 +374,9 @@ struct _FrWindowPrivate {
 };
 
 
+G_DEFINE_TYPE_WITH_PRIVATE (FrWindow, fr_window, GTK_TYPE_APPLICATION_WINDOW)
+
+
 /* -- fr_window_free_private_data -- */
 
 
@@ -658,7 +657,6 @@ fr_window_finalize (GObject *object)
 
        if (window->priv != NULL) {
                fr_window_free_private_data (window);
-               g_free (window->priv);
                window->priv = NULL;
        }
 
@@ -885,7 +883,7 @@ fr_window_class_init (FrWindowClass *klass)
 static void
 fr_window_init (FrWindow *window)
 {
-       window->priv = g_new0 (FrWindowPrivate, 1);
+       window->priv = fr_window_get_instance_private (window);
        window->priv->update_dropped_files = FALSE;
        window->priv->dnd_extract_is_running = FALSE;
        window->priv->dnd_extract_finished_with_error = FALSE;


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