Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2009-08-23 20:03:12 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2009-08-23 20:03:12 +0400
commit008a6cc1eccc9996978321a6abe9e53964a79368 (patch)
treee8fb9fa1f3720e0b0276d43219b0fb00624898db /source/blender/freestyle/intern
parenta1d560fc899df335f11ff5382359f431f8f835a2 (diff)
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.
Diffstat (limited to 'source/blender/freestyle/intern')
-rwxr-xr-xsource/blender/freestyle/intern/system/PythonInterpreter.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/freestyle/intern/system/PythonInterpreter.h b/source/blender/freestyle/intern/system/PythonInterpreter.h
index 4784f1ea96a..fa796630b9a 100755
--- a/source/blender/freestyle/intern/system/PythonInterpreter.h
+++ b/source/blender/freestyle/intern/system/PythonInterpreter.h
@@ -77,16 +77,18 @@ class LIB_SYSTEM_EXPORT PythonInterpreter : public Interpreter
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;
}