diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2015-10-01 19:11:12 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-10-01 19:11:12 +0300 |
commit | 550527bed04276cb29af6e5ad394e6b0b6adbfd9 (patch) | |
tree | 3a7b510a4990e71e143de5a18f86f37b482c1f66 /source/blender/compositor/operations | |
parent | 9ad829da7bde6e9996adf3ba817a89a4825da486 (diff) |
Fix memory leak in compositor code with RGB curve nodes.
Diffstat (limited to 'source/blender/compositor/operations')
-rw-r--r-- | source/blender/compositor/operations/COM_CurveBaseOperation.cpp | 15 | ||||
-rw-r--r-- | source/blender/compositor/operations/COM_CurveBaseOperation.h | 1 |
2 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/compositor/operations/COM_CurveBaseOperation.cpp b/source/blender/compositor/operations/COM_CurveBaseOperation.cpp index 408395bfcf0..9bb5ac88343 100644 --- a/source/blender/compositor/operations/COM_CurveBaseOperation.cpp +++ b/source/blender/compositor/operations/COM_CurveBaseOperation.cpp @@ -34,14 +34,25 @@ CurveBaseOperation::CurveBaseOperation() : NodeOperation() { this->m_curveMapping = NULL; } + +CurveBaseOperation::~CurveBaseOperation() +{ + if (this->m_curveMapping) { + curvemapping_free(this->m_curveMapping); + this->m_curveMapping = NULL; + } +} + void CurveBaseOperation::initExecution() { curvemapping_initialize(this->m_curveMapping); } void CurveBaseOperation::deinitExecution() { - curvemapping_free(this->m_curveMapping); - this->m_curveMapping = NULL; + if (this->m_curveMapping) { + curvemapping_free(this->m_curveMapping); + this->m_curveMapping = NULL; + } } void CurveBaseOperation::setCurveMapping(CurveMapping *mapping) diff --git a/source/blender/compositor/operations/COM_CurveBaseOperation.h b/source/blender/compositor/operations/COM_CurveBaseOperation.h index 6bfce26f532..154eb18e387 100644 --- a/source/blender/compositor/operations/COM_CurveBaseOperation.h +++ b/source/blender/compositor/operations/COM_CurveBaseOperation.h @@ -33,6 +33,7 @@ protected: CurveMapping *m_curveMapping; public: CurveBaseOperation(); + ~CurveBaseOperation(); /** * Initialize the execution |