diff options
3 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStyleModule.h b/source/blender/freestyle/intern/blender_interface/BlenderStyleModule.h index 4c6f7e02722..7a1ce0a082b 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStyleModule.h +++ b/source/blender/freestyle/intern/blender_interface/BlenderStyleModule.h @@ -51,6 +51,10 @@ public: virtual ~BlenderStyleModule() { + } + + virtual void close() + { BKE_text_unlink(G.main, _text); BKE_libblock_free(&G.main->text, _text); } diff --git a/source/blender/freestyle/intern/stroke/Canvas.cpp b/source/blender/freestyle/intern/stroke/Canvas.cpp index 4427192a7b0..3fd2f9252d9 100644 --- a/source/blender/freestyle/intern/stroke/Canvas.cpp +++ b/source/blender/freestyle/intern/stroke/Canvas.cpp @@ -140,7 +140,6 @@ void Canvas::postDraw() update(); } - void Canvas::Clear() { if (!_Layers.empty()) { @@ -153,8 +152,10 @@ void Canvas::Clear() if (!_StyleModules.empty()) { for (deque<StyleModule*>::iterator s = _StyleModules.begin(), send = _StyleModules.end(); s != send; ++s) { - if (*s) + if (*s) { + (*s)->close(); delete (*s); + } } _StyleModules.clear(); } @@ -234,7 +235,6 @@ void Canvas::RemoveStyleModule(unsigned index) } } - void Canvas::SwapStyleModules(unsigned i1, unsigned i2) { StyleModule *tmp; diff --git a/source/blender/freestyle/intern/stroke/StyleModule.h b/source/blender/freestyle/intern/stroke/StyleModule.h index 12f645f125b..3d053f9b4e1 100644 --- a/source/blender/freestyle/intern/stroke/StyleModule.h +++ b/source/blender/freestyle/intern/stroke/StyleModule.h @@ -98,6 +98,8 @@ public: return sl; } + virtual void close() {} + protected: virtual int interpret() { |