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:
authorMaxime Curioni <maxime.curioni@gmail.com>2008-12-10 21:36:56 +0300
committerMaxime Curioni <maxime.curioni@gmail.com>2008-12-10 21:36:56 +0300
commit8b3e4bc069620a70da003f9ddff963db69ed297b (patch)
tree811459946b8338e5238099f9f50747c223ad016a /source/blender
parenteaae4090c1ade6ed1d8eb321e492e277035e5c54 (diff)
when Freestyle would execute style modules, a copy of the Python script would end up in the text editor and pollute the text editor file list. This is corrected: executed scripts do not leave trails behind.
Diffstat (limited to 'source/blender')
-rwxr-xr-xsource/blender/freestyle/intern/system/PythonInterpreter.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/freestyle/intern/system/PythonInterpreter.h b/source/blender/freestyle/intern/system/PythonInterpreter.h
index 64b5c5488d0..4784f1ea96a 100755
--- a/source/blender/freestyle/intern/system/PythonInterpreter.h
+++ b/source/blender/freestyle/intern/system/PythonInterpreter.h
@@ -37,8 +37,12 @@
//soc
extern "C" {
+#include "BKE_main.h"
+#include "BKE_global.h"
#include "BKE_text.h"
+#include "BKE_library.h"
#include "BPY_extern.h"
+#include "BIF_drawtext.h"
}
class LIB_SYSTEM_EXPORT PythonInterpreter : public Interpreter
@@ -78,7 +82,11 @@ class LIB_SYSTEM_EXPORT PythonInterpreter : public Interpreter
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;
}
@@ -122,6 +130,10 @@ private:
BPY_txt_do_python_Text(text);
+ // cleaning up
+ unlink_text(text);
+ free_libblock(&G.main->text, text);
+
//PyRun_SimpleString("from Freestyle import *");
_initialized = true;
}