From bac4df147de363a0774548acd63d367a09ab50d3 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Thu, 20 Sep 2012 22:40:55 +0200 Subject: some memleak fixes (Bug #1043571) (bzr r11686) --- src/sp-object.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/sp-object.cpp') diff --git a/src/sp-object.cpp b/src/sp-object.cpp index 892c89a15..9ceeaf262 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -1031,15 +1031,9 @@ Inkscape::XML::Node * SPObject::sp_object_private_write(SPObject *object, Inksca if( prefs->getBool("/options/svgoutput/check_on_editing") ) { unsigned int flags = sp_attribute_clean_get_prefs(); - gchar *s_cleaned = sp_attribute_clean_style( repr, s, flags ); - - // g_warning("SPObject::sp_object_private_write: %s", object->getId() ); - // g_warning(" old: :%s:", repr->attribute("style") ); - // g_warning(" new: :%s:", s ); - // g_warning(" cleaned: :%s:", s_cleaned ); - + Glib::ustring s_cleaned = sp_attribute_clean_style( repr, s, flags ); g_free( s ); - s = s_cleaned; + s = (s_cleaned.empty() ? NULL : g_strdup (s_cleaned.c_str())); } if( s == NULL || strcmp(s,"") == 0 ) { -- cgit v1.2.3