Code

Fix a memory leak in sp_canvastext
authorDiederik van Lierop <mailat-signdiedenrezidotnl>
Wed, 17 Feb 2010 21:45:04 +0000 (22:45 +0100)
committerDiederik van Lierop <mailat-signdiedenrezidotnl>
Wed, 17 Feb 2010 21:45:04 +0000 (22:45 +0100)
src/display/canvas-text.cpp

index 1c715291ffed0dc8b0953ccc7e272dfdd4756b0b..d32bc20c3f07638349a4acc431755ec65d02ef41 100644 (file)
@@ -91,7 +91,9 @@ sp_canvastext_destroy (GtkObject *object)
 
     SPCanvasText *canvastext = SP_CANVASTEXT (object);
 
-    canvastext->item=NULL;
+    g_free(canvastext->text);
+    canvastext->text = NULL;
+    canvastext->item = NULL;
 
     if (GTK_OBJECT_CLASS (parent_class_ct)->destroy)
         (* GTK_OBJECT_CLASS (parent_class_ct)->destroy) (object);