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:
authorCampbell Barton <ideasman42@gmail.com>2010-08-03 07:53:36 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-03 07:53:36 +0400
commit233df907d060010bb19e5576d29c6e5171983258 (patch)
treeed6cc8e2afed59ad47db0335648043fe947de78e /source/blender
parentc475f382395d1556fc0fb80c709f7dc08c97eb10 (diff)
py/rna update, reload works again.
- fix for reload (f8) crashing, missing incref when creating the script namespace. - store the module names rather then the modules for reloading incase the modules get out of date.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/python/intern/bpy_interface.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 375bf20797b..5fe755747d3 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -160,11 +160,10 @@ static PyObject *CreateGlobalDictionary(bContext *C, const char *filename)
PyObject *mod_main= PyModule_New("__main__");
PyDict_SetItemString(interp->modules, "__main__", mod_main);
Py_DECREF(mod_main); /* sys.modules owns now */
-
- PyModule_AddObject(mod_main, "__builtins__", interp->builtins);
PyModule_AddStringConstant(mod_main, "__name__", "__main__");
PyModule_AddStringConstant(mod_main, "__file__", filename); /* __file__ only for nice UI'ness */
-
+ PyModule_AddObject(mod_main, "__builtins__", interp->builtins);
+ Py_INCREF(interp->builtins); /* AddObject steals a reference */
return PyModule_GetDict(mod_main);
}