mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Correct memory handling of scm_to_locale_string per guile manual
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20758 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
61208eb617
commit
75c97e4705
@ -74,7 +74,7 @@ acct_tree_add_accts(SCM accts,
|
|||||||
GtkTreeRowReference **reference)
|
GtkTreeRowReference **reference)
|
||||||
{
|
{
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
const char * compname;
|
char * compname;
|
||||||
char * acctname;
|
char * acctname;
|
||||||
gboolean leafnode;
|
gboolean leafnode;
|
||||||
SCM current;
|
SCM current;
|
||||||
@ -92,9 +92,17 @@ acct_tree_add_accts(SCM accts,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (scm_is_string(SCM_CAR(current)))
|
if (scm_is_string(SCM_CAR(current)))
|
||||||
compname = scm_to_locale_string(SCM_CAR(current));
|
{
|
||||||
|
char * str;
|
||||||
|
|
||||||
|
scm_dynwind_begin (0);
|
||||||
|
str = scm_to_locale_string (SCM_CAR(current));
|
||||||
|
compname = g_strdup(str);
|
||||||
|
scm_dynwind_free (str);
|
||||||
|
scm_dynwind_end ();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
compname = "";
|
compname = g_strdup("");
|
||||||
|
|
||||||
if (!scm_is_null(SCM_CADDR(current)))
|
if (!scm_is_null(SCM_CADDR(current)))
|
||||||
{
|
{
|
||||||
@ -140,6 +148,7 @@ acct_tree_add_accts(SCM accts,
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_free(acctname);
|
g_free(acctname);
|
||||||
|
g_free(compname);
|
||||||
|
|
||||||
accts = SCM_CDR(accts);
|
accts = SCM_CDR(accts);
|
||||||
}
|
}
|
||||||
@ -327,8 +336,16 @@ qif_account_picker_dialog(QIFImportWindow * qif_wind, SCM map_entry)
|
|||||||
scm_gc_protect_object(wind->map_entry);
|
scm_gc_protect_object(wind->map_entry);
|
||||||
|
|
||||||
/* Set the initial account to be selected. */
|
/* Set the initial account to be selected. */
|
||||||
wind->selected_name = g_strdup(scm_to_locale_string(orig_acct));
|
if (scm_is_string(orig_acct))
|
||||||
|
{
|
||||||
|
char * str;
|
||||||
|
|
||||||
|
scm_dynwind_begin (0);
|
||||||
|
str = scm_to_locale_string (orig_acct);
|
||||||
|
wind->selected_name = g_strdup(str);
|
||||||
|
scm_dynwind_free (str);
|
||||||
|
scm_dynwind_end ();
|
||||||
|
}
|
||||||
|
|
||||||
xml = gnc_glade_xml_new("qif.glade", "QIF Import Account Picker");
|
xml = gnc_glade_xml_new("qif.glade", "QIF Import Account Picker");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user