From fd0a5dfa4cb237f8e5232c785693cc3e676336e8 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sun, 2 Sep 2012 21:32:59 +0200 Subject: converted some c-string usage to c++ string class usage: should fix some memory leaks (bzr r11646) --- src/preferences.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/preferences.cpp') diff --git a/src/preferences.cpp b/src/preferences.cpp index 4615fd6e1..1f985a629 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -489,18 +489,18 @@ void Preferences::setString(Glib::ustring const &pref_path, Glib::ustring const void Preferences::setStyle(Glib::ustring const &pref_path, SPCSSAttr *style) { - gchar *css_str = sp_repr_css_write_string(style); - _setRawValue(pref_path, css_str); - g_free(css_str); + Glib::ustring css_str; + sp_repr_css_write_string(style, css_str); + _setRawValue(pref_path, css_str.c_str()); } void Preferences::mergeStyle(Glib::ustring const &pref_path, SPCSSAttr *style) { SPCSSAttr *current = getStyle(pref_path); sp_repr_css_merge(current, style); - gchar *css_str = sp_repr_css_write_string(current); - _setRawValue(pref_path, css_str); - g_free(css_str); + Glib::ustring css_str; + sp_repr_css_write_string(current, css_str); + _setRawValue(pref_path, css_str.c_str()); sp_repr_css_attr_unref(current); } -- cgit v1.2.3