Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-10-10 13:49:32 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-10-10 13:57:36 +0400
commitc2d6de8e200742d480c41643efb377d2a76e0bc8 (patch)
treea6a01383ca0c51d1b54874267d0477040f530a9f /source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp
parent5fdbb793ff40a8c67200f147104fee6d3867afe1 (diff)
Freestyle: Fix for memory leaks in StrokeVertexIterator.
The issues identified here are regression from 2.71, so the present code revision is appropriate for backporting if 2.72a is planned.
Diffstat (limited to 'source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp')
-rw-r--r--source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp
index 275bfe99714..e35076ec7fe 100644
--- a/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp
+++ b/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp
@@ -155,9 +155,9 @@ static PyObject *StrokeVertexIterator_incremented(BPy_StrokeVertexIterator *self
PyErr_SetString(PyExc_RuntimeError, "cannot increment any more");
return NULL;
}
- StrokeInternal::StrokeVertexIterator *copy = new StrokeInternal::StrokeVertexIterator(*self->sv_it);
- copy->increment();
- return BPy_StrokeVertexIterator_from_StrokeVertexIterator(*copy, self->reversed);
+ StrokeInternal::StrokeVertexIterator copy(*self->sv_it);
+ copy.increment();
+ return BPy_StrokeVertexIterator_from_StrokeVertexIterator(copy, self->reversed);
}
PyDoc_STRVAR(StrokeVertexIterator_decremented_doc,
@@ -174,10 +174,9 @@ static PyObject *StrokeVertexIterator_decremented(BPy_StrokeVertexIterator *self
PyErr_SetString(PyExc_RuntimeError, "cannot decrement any more");
return NULL;
}
-
- StrokeInternal::StrokeVertexIterator *copy = new StrokeInternal::StrokeVertexIterator(*self->sv_it);
- copy->decrement();
- return BPy_StrokeVertexIterator_from_StrokeVertexIterator(*copy, self->reversed);
+ StrokeInternal::StrokeVertexIterator copy(*self->sv_it);
+ copy.decrement();
+ return BPy_StrokeVertexIterator_from_StrokeVertexIterator(copy, self->reversed);
}
PyDoc_STRVAR(StrokeVertexIterator_reversed_doc,
@@ -191,8 +190,7 @@ PyDoc_STRVAR(StrokeVertexIterator_reversed_doc,
static PyObject *StrokeVertexIterator_reversed(BPy_StrokeVertexIterator *self)
{
- StrokeInternal::StrokeVertexIterator *copy = new StrokeInternal::StrokeVertexIterator(*self->sv_it);
- return BPy_StrokeVertexIterator_from_StrokeVertexIterator(*copy, !self->reversed);
+ return BPy_StrokeVertexIterator_from_StrokeVertexIterator(*self->sv_it, !self->reversed);
}
static PyMethodDef BPy_StrokeVertexIterator_methods[] = {