Commit: 1bc28db0efc9666596aa60113e77d55f8eaf5c62
Author: Lukas Tönne
Date:   Thu Oct 1 18:11:12 2015 +0200
Branches: blender-v2.76-release
https://developer.blender.org/rB1bc28db0efc9666596aa60113e77d55f8eaf5c62

Fix memory leak in compositor code with RGB curve nodes.

===================================================================

M       source/blender/compositor/operations/COM_CurveBaseOperation.cpp
M       source/blender/compositor/operations/COM_CurveBaseOperation.h

===================================================================

diff --git a/source/blender/compositor/operations/COM_CurveBaseOperation.cpp 
b/source/blender/compositor/operations/COM_CurveBaseOperation.cpp
index 408395b..9bb5ac8 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 6bfce26..154eb18 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

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to