r22651 - gnucash/trunk/src - Guile 2: replace deprecated SCM_SYMBOL_CHARS function

Alex Aycinena alex.aycinena at gmail.com
Fri Dec 21 14:06:00 EST 2012


Geert,

On Sat, Dec 15, 2012 at 9:58 AM, Geert Janssens
<gjanssens at code.gnucash.org> wrote:
> Author: gjanssens
> Date: 2012-12-15 12:58:40 -0500 (Sat, 15 Dec 2012)
> New Revision: 22651
> Trac: http://svn.gnucash.org/trac/changeset/22651
>
> Added:
>    gnucash/trunk/src/core-utils/gnc-guile-utils.c
>    gnucash/trunk/src/core-utils/gnc-guile-utils.h
> Modified:
>    gnucash/trunk/src/app-utils/guile-util.c
>    gnucash/trunk/src/app-utils/guile-util.h
>    gnucash/trunk/src/app-utils/option-util.c
>    gnucash/trunk/src/core-utils/Makefile.am
>    gnucash/trunk/src/engine/engine-helpers.c
>    gnucash/trunk/src/gnome/dialog-tax-info.c
>    gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c
> Log:
> Guile 2: replace deprecated SCM_SYMBOL_CHARS function
>
> The replacements require guile 1.8 or above
>
> _______________________________________________
> gnucash-patches mailing list
> gnucash-patches at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-patches

A couple of years ago, I used valgrind to find and correct memory
leaks in some code I had previously committed. In that process I
discovered that some of my leaks were caused by
'scm_to_locale_string'.

I investigated on the internet and found that to prevent memory leaks
in scm_to_locale_string() per the guile manual (see
'http://www.gnu.org/software/guile/manual/html_node/Dynamic-Wind.html#Dynamic-Wind),
you needed to surround scm_to_locale_string() with calls to
scm_dynwind_begin (0) and scm_dynwind_free (str) followed by
scm_dynwind_end ().

So I added the code that you have removed with this commit. I also
added it in many more places, including in code that I hadn't
committed, to clear up more memory leaks. Later, I realized that I
should refactor my code to replace all the instances that I had put it
in with a call to gnc_scm_to_locale_string. I haven't got around to
that last part yet but it is on my to do list.

So my questions to you are:

1. were you aware of the memory leak issue with gnc_scm_to_locale_string?
2. has something changed between then and now that make this no longer
an issue and therefore the code no longer necessary?
3. does moving from guile 1.2 to guile 2 affect this in some way?

Regards,

Alex


More information about the gnucash-devel mailing list