diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-05-27 19:41:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-05-27 19:41:44 +0400 |
commit | 5936032f661395f18bcc15c3dba73e8b6f5e963b (patch) | |
tree | f40b7a14cecc498ec689a57a99fafe085a9229c2 /source | |
parent | e49c0b495a03735c704d139bbc4f28cd5ae99fe2 (diff) |
patch from Andrea Weikert, added some comments.
thanks for looking into this.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/intern/bpy_ui.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/python/intern/bpy_ui.c b/source/blender/python/intern/bpy_ui.c index 1c15fc34547..bbfb04719d8 100644 --- a/source/blender/python/intern/bpy_ui.c +++ b/source/blender/python/intern/bpy_ui.c @@ -387,7 +387,7 @@ PyObject *BPY_ui_module( void ) #if PY_VERSION_HEX >= 0x03000000 submodule= PyModule_Create(&ui_module); #else /* Py2.x */ - submodule= Py_InitModule3( "bpyui", ui_methods, "" ); + submodule= Py_InitModule3( "bpy.ui", ui_methods, "" ); #endif /* uiBlock->flag (controls) */ @@ -558,8 +558,10 @@ PyObject *BPY_ui_module( void ) PyModule_AddObject( mod, "TIME", PyLong_FromSsize_t(SPACE_TIME) ); PyModule_AddObject( mod, "NODE", PyLong_FromSsize_t(SPACE_NODE) ); - - + /* INCREF since its its assumed that all these functions return the + * module with a new ref like PyDict_New, since they are passed to + * PyModule_AddObject which steals a ref */ + Py_INCREF(submodule); return submodule; } |