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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-08-01 18:23:06 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-01 18:23:06 +0400
commit7524967238698ca770a76365a782f299c5d2ac86 (patch)
treefe573b70affb3e883d763b52123049e30bdec89c /source
parent4a63d2a2d28df692e57a2795b03bbd918f3f50e7 (diff)
- new __main__ module wasnt de-referenced after adding into sys.modules
- made int buttons round floats better 10.6 --> 11
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface.c2
-rw-r--r--source/blender/python/intern/bpy_interface.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 7b67a458ae2..38c11e507cc 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1644,7 +1644,7 @@ int ui_set_but_string(bContext *C, uiBut *but, const char *str)
value= atof(str);
#endif
- if(!ui_is_but_float(but)) value= (int)value;
+ if(!ui_is_but_float(but)) value= (int)floor(value + 0.5);
if(but->type==NUMABS) value= fabs(value);
/* not that we use hard limits here */
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 731c31af4fc..901e8e8e103 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -159,6 +159,7 @@ static PyObject *CreateGlobalDictionary(bContext *C, const char *filename)
PyInterpreterState *interp= PyThreadState_GET()->interp;
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__");