UI handler leak fix patch



We've been noticing some annoying problems (mostly warnings) with Nautilus
lately. I tracked it down to some UI handler leaks. Here's a patch to
reinstate some code and add an unref that fixes some leaks. I also made a
change to Nautilus so we'll catch these leaks right away in the future.

Michael, I'd like to hear from you right away if reinstating the code to
unref the UI handler in bonobo_control_destroy is a problem. Please let me
know if it's OK to commit my patch.

===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-control.c,v
retrieving revision 1.38
diff -p -u -r1.38 bonobo-control.c
--- bonobo/bonobo-control.c    2000/09/02 06:57:15    1.38
+++ bonobo/bonobo-control.c    2000/09/06 01:17:13
@@ -176,6 +176,8 @@ bonobo_control_auto_merge (BonoboControl
 
     bonobo_ui_handler_set_container (control->priv->uih, remote_uih);
 
+    bonobo_object_release_unref (remote_uih, NULL);
+
 #ifdef STALE_NOT_USED
     if (control->priv->menus != NULL) {
         bonobo_ui_handler_menu_add_list (
@@ -739,7 +741,6 @@ bonobo_control_destroy (GtkObject *objec
 
     CORBA_exception_free (&ev);
 
-#ifdef STALE_NOT_USED
     /*
      * If we have a UIHandler, destroy it.
      */
@@ -747,7 +748,6 @@ bonobo_control_destroy (GtkObject *objec
         bonobo_ui_handler_unset_container (control->priv->uih);
         bonobo_object_unref (BONOBO_OBJECT (control->priv->uih));
     }
-#endif
 }
===================================================================

    -- Darin





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