[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54778] branches/soc-2008-mxcurioni/source /blender/freestyle/intern/stroke/BasicStrokeShaders.cpp: Fix for texture images left unreleased.

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Sat Feb 23 04:05:41 CET 2013


Revision: 54778
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54778
Author:   kjym3
Date:     2013-02-23 03:05:38 +0000 (Sat, 23 Feb 2013)
Log Message:
-----------
Fix for texture images left unreleased.

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp	2013-02-23 02:47:22 UTC (rev 54777)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp	2013-02-23 03:05:38 UTC (rev 54778)
@@ -204,22 +204,22 @@
 	_stretch = stretch;
 	_minThickness = iMinThickness;
 	_maxThickness = iMaxThickness;
-	ImBuf *image = NULL; //soc
+	ImBuf *image = NULL;
 	vector<string> pathnames;
 	StringUtils::getPathName(TextureManager::Options::getPatternsPath(), pattern_name, pathnames);
 	for (vector<string>::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 @@
 ColorVariationPatternShader::ColorVariationPatternShader(const string pattern_name, bool stretch) : StrokeShader()
 {
 	_stretch = stretch;
-	ImBuf *image = NULL; //soc
+	ImBuf *image = NULL;
 	vector<string> pathnames;
 	StringUtils::getPathName(TextureManager::Options::getPatternsPath(), pattern_name, pathnames);
 	for (vector<string>::const_iterator j = pathnames.begin(); j != pathnames.end(); ++j) {
@@ -347,10 +347,11 @@
 			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




More information about the Bf-blender-cvs mailing list