diff --git a/src/report/report-gnome/dialog-column-view.c b/src/report/report-gnome/dialog-column-view.c index 03c384d30a..1d6da02963 100644 --- a/src/report/report-gnome/dialog-column-view.c +++ b/src/report/report-gnome/dialog-column-view.c @@ -150,10 +150,16 @@ update_display_lists(gnc_column_view_edit * view) { for (i = 0; !scm_is_null(names); names = SCM_CDR(names), i++) { + char * str; + if (scm_is_equal (SCM_CAR(names), selection)) row = i; - name = _(scm_to_locale_string(scm_call_2(template_menu_name, SCM_CAR(names), - SCM_BOOL_F))); + scm_dynwind_begin (0); + str = scm_to_locale_string (scm_call_2(template_menu_name, SCM_CAR(names), + SCM_BOOL_F)); + name = _(g_strdup (str)); + scm_dynwind_free (str); + scm_dynwind_end (); gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, AVAILABLE_COL_NAME, name, @@ -192,12 +198,18 @@ update_display_lists(gnc_column_view_edit * view) { for (i = 0; !scm_is_null(contents); contents = SCM_CDR(contents), i++) { + char * str; + if (scm_is_equal (SCM_CAR(contents), selection)) row = i; id = scm_num2int(SCM_CAAR(contents), SCM_ARG1, G_STRFUNC); this_report = gnc_report_find(id); - name = _(scm_to_locale_string(scm_call_1(report_menu_name, this_report))); + scm_dynwind_begin (0); + str = scm_to_locale_string (scm_call_1(report_menu_name, this_report)); + name = _(g_strdup (str)); + scm_dynwind_free (str); + scm_dynwind_end (); gtk_list_store_append(store, &iter); gtk_list_store_set diff --git a/src/report/report-gnome/dialog-style-sheet.c b/src/report/report-gnome/dialog-style-sheet.c index c36bda9252..00dd67e1a5 100644 --- a/src/report/report-gnome/dialog-style-sheet.c +++ b/src/report/report-gnome/dialog-style-sheet.c @@ -199,8 +199,15 @@ gnc_style_sheet_new (StyleSheetDialog * ssd) /* put in the list of style sheet type names */ for (; !scm_is_null(templates); templates = SCM_CDR(templates)) { + char * str; + const char* orig_name; + SCM t = SCM_CAR(templates); - const char* orig_name = scm_to_locale_string(scm_call_1(t_name, t)); + scm_dynwind_begin (0); + str = scm_to_locale_string (scm_call_1(t_name, t)); + orig_name = g_strdup (str); + scm_dynwind_free (str); + scm_dynwind_end (); /* Store the untranslated names for lookup later */ template_names = g_list_prepend (template_names, (gpointer)orig_name); @@ -251,12 +258,17 @@ gnc_style_sheet_select_dialog_add_one(StyleSheetDialog * ss, { SCM get_name, scm_name; const gchar *c_name; + char * str; GtkTreeSelection *selection; GtkTreeIter iter; get_name = scm_c_eval_string("gnc:html-style-sheet-name"); scm_name = scm_call_1(get_name, sheet_info); - c_name = scm_to_locale_string(scm_name); + scm_dynwind_begin (0); + str = scm_to_locale_string (scm_name); + c_name = g_strdup (str); + scm_dynwind_free (str); + scm_dynwind_end (); if (!c_name) return; diff --git a/src/report/report-gnome/window-report.c b/src/report/report-gnome/window-report.c index fe2b66ab69..8b44fe758d 100644 --- a/src/report/report-gnome/window-report.c +++ b/src/report/report-gnome/window-report.c @@ -159,13 +159,23 @@ gnc_report_window_default_params_editor(SCM options, SCM report) { ptr = scm_call_1(get_template_name, ptr); if (scm_is_string(ptr)) - title = scm_to_locale_string(ptr); + { + char * str; + + scm_dynwind_begin (0); + str = scm_to_locale_string (ptr); + title = g_strdup (str); + scm_dynwind_free (str); + scm_dynwind_end (); + } } } /* Don't forget to translate the window title */ prm->win = gnc_options_dialog_new((gchar*) (title && *title ? _(title) : "")); + g_free ((gpointer *) title); + scm_gc_protect_object(prm->scm_options); scm_gc_protect_object(prm->cur_report);