[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22722] branches/soc-2008-mxcurioni/source /blender/freestyle/intern/system/PythonInterpreter.h: Fixed a bug in PythonInterpreter::interpretFile() that a temporary

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Sun Aug 23 18:03:12 CEST 2009


Revision: 22722
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22722
Author:   kjym3
Date:     2009-08-23 18:03:12 +0200 (Sun, 23 Aug 2009)

Log Message:
-----------
Fixed a bug in PythonInterpreter::interpretFile() that a temporary
text object storing a Python script was not properly freed when an
error occurred during the execution of the script.

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/PythonInterpreter.h

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/PythonInterpreter.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/PythonInterpreter.h	2009-08-23 13:15:10 UTC (rev 22721)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/PythonInterpreter.h	2009-08-23 16:03:12 UTC (rev 22722)
@@ -77,16 +77,18 @@
 		cout << "couldn't create Blender text from" << fn << endl;
 	}
 
-	if (BPY_txt_do_python_Text(text) != 1) {
+	int status = BPY_txt_do_python_Text(text);
+
+	// cleaning up
+	unlink_text(text);
+	free_libblock(&G.main->text, text);
+	
+	if (status != 1) {
 		cout << "\nError executing Python script from PythonInterpreter::interpretFile:" << endl;
 		cout << fn << " (at line " <<  BPY_Err_getLinenumber() << ")" << endl;
 		return BPY_Err_getLinenumber();
 	}
 	
-	// cleaning up
-	unlink_text(text);
-	free_libblock(&G.main->text, text);
-	
 	return 0;
   }
 





More information about the Bf-blender-cvs mailing list