Patch for occasional UIHandler bug



After many an hour with purify and gdb I have tracked down the bug
in the BonoboUIHandler that causes intermittent crashes when repeatedly
merging menubars and toolbars. The name_to_dock hashtable was not
being gleaned of its removed entries and so it would return released
CORBA_Objects, in turn causing Bad Things to Happen (TM).

This patch fixes it, according to my own experience and purify.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/bonobo/ChangeLog,v
retrieving revision 1.452
diff -u -r1.452 ChangeLog
--- ChangeLog   2000/07/25 19:22:12     1.452
+++ ChangeLog   2000/07/25 23:05:22
@@ -1,3 +1,9 @@
+2000-07-25  Peter Williams  <peterw@helixcode.com>
+
+       * bonobo/bonobo-uih-dock.c (bonobo_ui_handler_dock_remove_data):
+       Don't just free the CORBA_Object: remove the data from the hash 
+       table and free the key and value.
+
 2000-07-25  Michael Meeks  <michael@helixcode.com>
 
        * bonobo/bonobo.h: add sizeable
Index: bonobo/bonobo-uih-dock.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-uih-dock.c,v
retrieving revision 1.4
diff -u -r1.4 bonobo-uih-dock.c
--- bonobo/bonobo-uih-dock.c    2000/04/30 22:27:37     1.4
+++ bonobo/bonobo-uih-dock.c    2000/07/25 23:05:22
@@ -132,12 +132,11 @@
                return FALSE;
        }
 
-/*
+       g_hash_table_remove (uih->top->name_to_dock, key);
+       g_free (internal->name);
        g_free (internal); 
-       g_free (internal->name); FIXME */
-
        g_free (key);
-
+       
        CORBA_exception_free (&ev);
 
        return TRUE;

--

Peter Williams -- peterw@helixcode.com




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