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

Re: gEDA-dev: Crash updating embeded component



On Sun, 2006-12-03 at 20:54 +0000, Peter Clifton wrote:
> I've discovered a potential crash in gschem... (It does some times).
> 
> If you have a component, embed that component in the schematic (from
> edit menu), then go to Edit->Update component _twice_, the component
> gets replaced with a "can't find component warning, and valgrind notes
> some errors.

Talking to myself again...

Attached is a patch which fixes the issue, but it needs checking that it
is indeed the correct thing to do.

Previously we had that clib was allocated in the embeded component
state, and so we free'd it. Actually, it appears that clib comes from a
hash table owned by libgeda, and should NOT be free'd.

Patch attached.

Peter C.

diff --git a/gschem/src/o_misc.c b/gschem/src/o_misc.c
index d899ebe..3dc3f55 100644
--- a/gschem/src/o_misc.c
+++ b/gschem/src/o_misc.c
@@ -1661,9 +1661,8 @@ void o_update_component(TOPLEVEL *w_curr
   o_redraw_single (w_current, o_current);
 
   if (is_embedded) {
-    /* we previously allocated memory for basename and clib */
+    /* we previously allocated memory for basename */
     g_free (basename);
-    g_free (clib);
   }
     
   /* mark the page as modified */


_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev