summaryrefslogtreecommitdiffstats
path: root/src/object/sp-text.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2019-10-04 16:26:34 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2019-10-05 10:35:21 +0000
commit95e00bdf7075329277cac97a6fd0a929c9a8e453 (patch)
treeff4521ff8f759eec5aac329efbf00bbca68f0d70 /src/object/sp-text.cpp
parentFix segfault with bad SVG file. (diff)
downloadinkscape-95e00bdf7075329277cac97a6fd0a929c9a8e453.tar.gz
inkscape-95e00bdf7075329277cac97a6fd0a929c9a8e453.zip
Fix some memory leaks found by scan-build
Diffstat (limited to 'src/object/sp-text.cpp')
-rw-r--r--src/object/sp-text.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/object/sp-text.cpp b/src/object/sp-text.cpp
index bf406601e..7786bf69c 100644
--- a/src/object/sp-text.cpp
+++ b/src/object/sp-text.cpp
@@ -767,8 +767,8 @@ unsigned SPText::_buildLayoutInput(SPObject *object, Inkscape::Text::Layout::Opt
Shape* SPText::_buildExclusionShape() const
{
- Shape *result = new Shape(); // Union of all exclusion shapes
- Shape *shape_temp = new Shape();
+ std::unique_ptr<Shape> result(new Shape()); // Union of all exclusion shapes
+ std::unique_ptr<Shape> shape_temp(new Shape());
for(auto shape_id : style->shape_subtract.shape_ids) {
@@ -799,7 +799,7 @@ Shape* SPText::_buildExclusionShape() const
uncross->ConvertToShape( sh );
if (result->hasEdges()) {
- shape_temp->Booleen(result, uncross, bool_op_union);
+ shape_temp->Booleen(result.get(), uncross, bool_op_union);
std::swap(result, shape_temp);
} else {
result->Copy(uncross);
@@ -807,7 +807,7 @@ Shape* SPText::_buildExclusionShape() const
}
}
}
- return result;
+ return result.release();
}