delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2020/12/11/11:24:42

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
Date: Fri, 11 Dec 2020 17:05:11 +0100 (CET)
From: Roland Lutz <rlutz AT hedmen DOT org>
To: "Glenn (glimrick AT epilitimus DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
Subject: [geda-user] Memory leak patches (was: SAB processing patches)
In-Reply-To: <8706c896-e01a-9e6e-2bab-fe3607064093@epilitimus.com>
Message-ID: <alpine.DEB.2.21.2012111645180.13096@nimbus>
References: <e4ff3c96-939b-a93e-a32f-5e938b6daa63 AT epilitimus DOT com> <alpine DOT DEB DOT 2 DOT 21 DOT 2011302045040 DOT 2894 AT nimbus> <20201130220505 DOT 0AE4282C54FD AT turkos DOT aspodata DOT se> <7c75ed03-456c-b408-8b50-0448f6b3a04f AT epilitimus DOT com> <alpine DOT DEB DOT 2 DOT 21 DOT 2012011606400 DOT 6785 AT nimbus>
<1b2c64b3-6a36-c1f3-dd54-bb583c6bea17 AT epilitimus DOT com> <alpine DOT DEB DOT 2 DOT 21 DOT 2012021253440 DOT 1262 AT nimbus> <475f980e-fddd-60d1-9a02-a5bc5fb5805b AT epilitimus DOT com> <alpine DOT DEB DOT 2 DOT 21 DOT 2012071333290 DOT 3907 AT nimbus> <e6c5135f-b127-fd55-91b2-79aa357a5a07 AT epilitimus DOT com>
<alpine DOT DEB DOT 2 DOT 21 DOT 2012081644480 DOT 3649 AT nimbus> <8706c896-e01a-9e6e-2bab-fe3607064093 AT epilitimus DOT com>
User-Agent: Alpine 2.21 (DEB 202 2017-01-01)
MIME-Version: 1.0
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Hi Glenn,

On Tue, 8 Dec 2020, Glenn (glimrick AT epilitimus DOT com) [via 
geda-user AT delorie DOT com] wrote:
> There is currently only one commit to the mem_leak branch, commit 
> 5ccfd8b8a2

thank you for fixing these!

A few of the variables you freed were actually still in use, so I had to 
change a few things.  In particular, g_object_set_data takes a generic 
pointer, so the string mustn't be freed while the object is still around. 
In eda_config_get_context_for_file, the path object must only be freed if 
it was created in the function or it would result in a double free; and in 
restore_current_page, you accidentally freed the configuration context 
instead of the retrieved string.  I also moved the convenience function 
you introduced to i_basic.c and made it static (no need to pollute the 
global namespace with something that is only used once), removed a comment 
which made only sense if you knew the previous version of the code 
(comments like this go better into the commit message), simplified the 
free handling in x_clipboard.c, and applied gEDA/gaf coding style.

May I ask how you proceeded to find these leaks?  I always struggled to do 
memory analysis on gschem because of the large amount of warnings 
introduced by Guile and Gtk.

It will take me some more time to review the SAB patches; this is 
something which requires my full attention, so I can't just fit it into 
any free time slot.

Roland

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019