summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2013-09-30 19:59:36 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2013-09-30 19:59:36 +0000
commit799f473597d4eb61d843c37b2e294824c919db73 (patch)
tree8c5df12ff8b8c7d899a191bbb41d1ff9d6995d5b /src
parentfix memleak (duplicating string is not necessary, as ustring's constructor a... (diff)
downloadinkscape-799f473597d4eb61d843c37b2e294824c919db73.tar.gz
inkscape-799f473597d4eb61d843c37b2e294824c919db73.zip
fix memleak
(bzr r12633)
Diffstat (limited to 'src')
-rw-r--r--src/display/guideline.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/display/guideline.cpp b/src/display/guideline.cpp
index f71bc82ef..55c1ee495 100644
--- a/src/display/guideline.cpp
+++ b/src/display/guideline.cpp
@@ -94,14 +94,20 @@ static void sp_guideline_destroy(SPCanvasItem *object)
g_return_if_fail (SP_IS_GUIDELINE (object));
//g_return_if_fail (SP_GUIDELINE(object)->origin != NULL);
//g_return_if_fail (SP_IS_CTRLPOINT(SP_GUIDELINE(object)->origin));
-
- if (SP_GUIDELINE(object)->origin != NULL && SP_IS_CTRLPOINT(SP_GUIDELINE(object)->origin)) {
- sp_canvas_item_destroy(SP_GUIDELINE(object)->origin);
+
+ SPGuideLine *gl = SP_GUIDELINE(object);
+
+ if (gl->origin != NULL && SP_IS_CTRLPOINT(gl->origin)) {
+ sp_canvas_item_destroy(gl->origin);
} else {
// FIXME: This branch shouldn't be reached (although it seems to be harmless).
//g_error("Why can it be that gl->origin is not a valid SPCtrlPoint?\n");
}
+ if (gl->label) {
+ g_free(gl->label);
+ }
+
SP_CANVAS_ITEM_CLASS(parent_class)->destroy(object);
}