]> git.sur5r.net Git - glabels/commitdiff
Much cleaner implementation of fix for Bug #822848.
authorJim Evins <evins@snaught.com>
Tue, 28 Oct 2003 00:53:02 +0000 (00:53 +0000)
committerJim Evins <evins@snaught.com>
Tue, 28 Oct 2003 00:53:02 +0000 (00:53 +0000)
git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@330 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/src/ui.c
glabels2/src/ui.h
glabels2/src/window.c

index 0900d653a918f1639f271d9d72e4a8ec92dd1d40..acb3332f83b2a19dad762f061b370f4375192306 100644 (file)
@@ -333,12 +333,29 @@ gl_ui_init (BonoboUIComponent *ui_component,
        g_signal_connect (G_OBJECT (recent_view), "activate",
                          G_CALLBACK (gl_file_open_recent), win);
 
-       /* Hack:  squirrel away a copy to be unreferenced in gl_window_destroy() */
+       /* Squirrel away a copy to be unreferenced in gl_ui_unref() */
        g_object_set_data (G_OBJECT (ui_component), "recent-view", recent_view);
 
        gl_debug (DEBUG_UI, "END");
 }
 
+/*****************************************************************************/
+/* Unref wrapper.                                                            */
+/*****************************************************************************/
+void
+gl_ui_unref (BonoboUIComponent *ui_component)
+{
+       EggRecentView *recent_view;
+
+       /* Pull out recent view to unreference. */
+       recent_view = g_object_get_data (G_OBJECT(ui_component), "recent-view");
+       if (recent_view) {
+               g_object_unref (recent_view);
+       }
+
+       bonobo_object_unref(ui_component);
+}
+
 /*****************************************************************************/
 /* Update all verbs of given UI component.                                   */
 /*****************************************************************************/
index 51d0f452d6b08aeb18bb86c151c4c1c39b9eea2e..3d326e946a5d4d798e23df488d5955a881125d0f 100644 (file)
@@ -35,6 +35,8 @@ void gl_ui_init                   (BonoboUIComponent *ui_component,
                                   GtkWidget         *cursor_info_frame,
                                   GtkWidget         *zoom_info_frame);
 
+void gl_ui_unref                  (BonoboUIComponent *ui_component);
+
 void gl_ui_update_all             (BonoboUIComponent *ui_component,
                                   glView            *view);
 
index 347b4d084187b197da2d8cdb40e96f43ca1e44cc..21cbedb3d78a332328135df87bfb32d02f4e4c2d 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <config.h>
 
-#include "recent-files/egg-recent-view.h"
 #include "ui.h"
 #include "window.h"
 #include "util.h"
@@ -216,15 +215,7 @@ gl_window_destroy (GtkObject *gtk_object)
        window_list = g_list_remove (window_list, window);
 
         if (window->uic) {
-               EggRecentView *recent_view;
-
-               /* Hack:  pull out recent view to unreference. */
-               recent_view = g_object_get_data (G_OBJECT(window->uic), "recent-view");
-               if (recent_view) {
-                       g_object_unref (recent_view);
-               }
-
-               bonobo_object_unref(window->uic);
+               gl_ui_unref(window->uic);
                window->uic = NULL;
         }