diff options
Diffstat (limited to 'source/blender')
6 files changed, 13 insertions, 10 deletions
diff --git a/source/blender/freestyle/intern/application/Controller.cpp b/source/blender/freestyle/intern/application/Controller.cpp index 7303ccc95f3..436cdbfe6b5 100644 --- a/source/blender/freestyle/intern/application/Controller.cpp +++ b/source/blender/freestyle/intern/application/Controller.cpp @@ -165,6 +165,11 @@ Controller::~Controller() _inter = NULL; } + if (_ProgressBar) { + delete _ProgressBar; + _ProgressBar = NULL; + } + //delete _current_dirs; } diff --git a/source/blender/freestyle/intern/geometry/FitCurve.cpp b/source/blender/freestyle/intern/geometry/FitCurve.cpp index c043f2cb0b9..cc21ba05f3d 100644 --- a/source/blender/freestyle/intern/geometry/FitCurve.cpp +++ b/source/blender/freestyle/intern/geometry/FitCurve.cpp @@ -487,6 +487,8 @@ void FitCurveWrapper::FitCurve(vector<Vec2d>& data, vector<Vec2d>& oCurve, doubl FitCurve(d, size, error); + delete[] d; + // copy results for (vector<Vector2>::iterator v = _vertices.begin(), vend = _vertices.end(); v != vend; ++v) { oCurve.push_back(Vec2d(v->x(), v->y())) ; diff --git a/source/blender/freestyle/intern/system/PseudoNoise.cpp b/source/blender/freestyle/intern/system/PseudoNoise.cpp index 77b7c565279..b70564d147c 100644 --- a/source/blender/freestyle/intern/system/PseudoNoise.cpp +++ b/source/blender/freestyle/intern/system/PseudoNoise.cpp @@ -32,15 +32,12 @@ namespace Freestyle { -static const unsigned NB_VALUE_NOISE = 512; - -real *PseudoNoise::_values; +real PseudoNoise::_values[]; PseudoNoise::PseudoNoise() {} void PseudoNoise::init(long seed) { - _values = new real[NB_VALUE_NOISE]; RandGen::srand48(seed); for (unsigned int i = 0; i < NB_VALUE_NOISE; i++) _values[i] = -1.0 + 2.0 * RandGen::drand48(); diff --git a/source/blender/freestyle/intern/system/PseudoNoise.h b/source/blender/freestyle/intern/system/PseudoNoise.h index 302b305325f..ce725723b59 100644 --- a/source/blender/freestyle/intern/system/PseudoNoise.h +++ b/source/blender/freestyle/intern/system/PseudoNoise.h @@ -53,7 +53,8 @@ public: static void init(long seed); protected: - static real *_values; + static const unsigned NB_VALUE_NOISE = 512; + static real _values[NB_VALUE_NOISE]; #ifdef WITH_CXX_GUARDEDALLOC public: diff --git a/source/blender/freestyle/intern/system/TimeStamp.cpp b/source/blender/freestyle/intern/system/TimeStamp.cpp index dc4e717486d..7c02095ad51 100644 --- a/source/blender/freestyle/intern/system/TimeStamp.cpp +++ b/source/blender/freestyle/intern/system/TimeStamp.cpp @@ -30,6 +30,6 @@ namespace Freestyle { LIB_SYSTEM_EXPORT -TimeStamp *TimeStamp::_instance = 0; +TimeStamp TimeStamp::_instance; } /* namespace Freestyle */ diff --git a/source/blender/freestyle/intern/system/TimeStamp.h b/source/blender/freestyle/intern/system/TimeStamp.h index 88063280363..052816c5a85 100644 --- a/source/blender/freestyle/intern/system/TimeStamp.h +++ b/source/blender/freestyle/intern/system/TimeStamp.h @@ -41,9 +41,7 @@ class LIB_SYSTEM_EXPORT TimeStamp public: static inline TimeStamp *instance() { - if (_instance == NULL) - _instance = new TimeStamp; - return _instance; + return &_instance; } inline unsigned getTimeStamp() const @@ -70,7 +68,7 @@ protected: TimeStamp(const TimeStamp&) {} private: - static TimeStamp *_instance; + static TimeStamp _instance; unsigned _time_stamp; #ifdef WITH_CXX_GUARDEDALLOC |