diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2012-09-20 20:40:55 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2012-09-20 20:40:55 +0000 |
| commit | bac4df147de363a0774548acd63d367a09ab50d3 (patch) | |
| tree | 849f3bc54cfa4ba5d9e219173bcc5d5240b38375 /src/preferences.cpp | |
| parent | Translations. inkscape.pot update. (diff) | |
| download | inkscape-bac4df147de363a0774548acd63d367a09ab50d3.tar.gz inkscape-bac4df147de363a0774548acd63d367a09ab50d3.zip | |
some memleak fixes (Bug #1043571)
(bzr r11686)
Diffstat (limited to 'src/preferences.cpp')
| -rw-r--r-- | src/preferences.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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); } |
