[ghex] Avoid showing status message on an already destroyed window



commit b47c9346abc43aaadbf4fbc44b86894e72e2cfbd
Author: Kalev Lember <kalevlember gmail com>
Date:   Wed Jul 27 20:26:07 2011 +0300

    Avoid showing status message on an already destroyed window
    
    Fixes critical when closing 2nd ghex window with File->Close:
    Bonobo-CRITICAL **: bonobo_ui_component_set: assertion `BONOBO_IS_UI_COMPONENT (component)' failed

 src/ui.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/ui.c b/src/ui.c
index b171f10..46d337c 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -619,16 +619,15 @@ close_cb (BonoboUIComponent *uic, gpointer user_data, const gchar* verbname)
 		win->gh = NULL;
         ghex_window_set_sensitivity(win);
 		ghex_window_set_doc_name(win, NULL);
+
+        /* Clear the contents of status bar after closing the files */
+        bonobo_ui_component_set_status(win->uic, " ", NULL);
     }
     else
         gtk_widget_destroy(GTK_WIDGET(win));	
 
     /* this implicitly destroys all views including this one */
     g_object_unref(G_OBJECT(doc));
-
-    /* This is to clear the contents of status  bar after closing the files */
-    bonobo_ui_component_set_status(win->uic, " ", NULL);
-
 }
 
 void



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