From ec34bf3c6796b57fa2316f694f4a3c9137e3f6ca Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Sat, 23 Feb 2013 03:05:38 +0000 Subject: Fix for texture images left unreleased. --- source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp b/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp index 73651e7d672..a083c6b2f1b 100644 --- a/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp +++ b/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp @@ -204,22 +204,22 @@ ThicknessVariationPatternShader::ThicknessVariationPatternShader(const string pa _stretch = stretch; _minThickness = iMinThickness; _maxThickness = iMaxThickness; - ImBuf *image = NULL; //soc + ImBuf *image = NULL; vector pathnames; StringUtils::getPathName(TextureManager::Options::getPatternsPath(), pattern_name, pathnames); for (vector::const_iterator j = pathnames.begin(); j != pathnames.end(); ++j) { ifstream ifs(j->c_str()); if (ifs.is_open()) { - //soc image.load(j->c_str()); /* OCIO_TODO: support different input color space */ image = IMB_loadiffname(j->c_str(), 0, NULL); break; } } - if (image == NULL) //soc + if (image == NULL) cerr << "Error: cannot find pattern \"" << pattern_name << "\" - check the path in the Options" << endl; else convert(image, &_aThickness, _size); + IMB_freeImBuf(image); } @@ -336,7 +336,7 @@ int IncreasingColorShader::shade(Stroke& stroke) const ColorVariationPatternShader::ColorVariationPatternShader(const string pattern_name, bool stretch) : StrokeShader() { _stretch = stretch; - ImBuf *image = NULL; //soc + ImBuf *image = NULL; vector pathnames; StringUtils::getPathName(TextureManager::Options::getPatternsPath(), pattern_name, pathnames); for (vector::const_iterator j = pathnames.begin(); j != pathnames.end(); ++j) { @@ -347,10 +347,11 @@ ColorVariationPatternShader::ColorVariationPatternShader(const string pattern_na break; } } - if (image == NULL) //soc + if (image == NULL) cerr << "Error: cannot find pattern \"" << pattern_name << "\" - check the path in the Options" << endl; else convert(image, &_aVariation, _size); + IMB_freeImBuf(image); } int ColorVariationPatternShader::shade(Stroke& stroke) const -- cgit v1.2.3