[gnac] Code cleanup to prevent warnings when destroying windows.



commit cf21db14734aecee84222c88d04b542bb4594cf5
Author: Benoît Dupasquier <bdupasqu src gnome org>
Date:   Thu Apr 22 16:50:00 2010 +0100

    Code cleanup to prevent warnings when destroying windows.

 src/gnac-prefs.c      |    4 +---
 src/gnac-properties.c |    4 +---
 src/gnac-ui.c         |    8 ++------
 3 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/src/gnac-prefs.c b/src/gnac-prefs.c
index 8e1f0dd..d2875c0 100644
--- a/src/gnac-prefs.c
+++ b/src/gnac-prefs.c
@@ -653,12 +653,10 @@ gnac_prefs_destroy(void)
   if (gnac_prefs_builder) {
     window = GTK_WIDGET(gtk_builder_get_object(gnac_prefs_builder, 
                                        "gnac_preference_window"));
+    if (window) gtk_widget_destroy(window);
     g_object_unref(gnac_prefs_builder);
     gnac_prefs_builder = NULL;
   }
 
   gnac_prefs_free_tooltip_patterns();
-
-  if (window)
-    gtk_widget_destroy(window);
 }
diff --git a/src/gnac-properties.c b/src/gnac-properties.c
index 35d4b4d..562a576 100644
--- a/src/gnac-properties.c
+++ b/src/gnac-properties.c
@@ -644,10 +644,8 @@ gnac_properties_destroy(void)
   if (gnac_properties_builder) {
     window = GTK_WIDGET(gtk_builder_get_object(gnac_properties_builder, 
                                             "properties_window"));
+    if (window) gtk_widget_destroy(window);
     g_object_unref(gnac_properties_builder);
     gnac_properties_builder = NULL;
   }
-
-  if (window) 
-    gtk_widget_destroy(window);
 }
diff --git a/src/gnac-ui.c b/src/gnac-ui.c
index 310111d..256df16 100644
--- a/src/gnac-ui.c
+++ b/src/gnac-ui.c
@@ -324,16 +324,12 @@ gnac_ui_destroy(void)
   
   if (gnac_main_builder) {
     main_window = gnac_ui_get_widget("main_window");
+    if (main_window) gtk_widget_destroy(main_window);
     about_dialog = gnac_ui_get_widget("aboutdialog");
+    if (about_dialog) gtk_widget_destroy(about_dialog);
     g_object_unref(gnac_main_builder); 
     gnac_main_builder = NULL;
   }
-
-  if (main_window) 
-    gtk_widget_destroy(main_window);
-
-  if (about_dialog)
-    gtk_widget_destroy(about_dialog);
 }
 
 



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