diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-10-15 10:12:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-10-15 11:00:16 +0300 |
commit | 5531697f6d4a27137dd91996ee80d452b7147a02 (patch) | |
tree | 8c024bc8acac8387a22cc7bfa43ed4d1a5691321 /source/blender/python/intern/bpy.c | |
parent | 1cc3abca701775e0ddb0756a262df99b8e7a0276 (diff) |
Cleanup: remove duplicate context variable (__py_context)
The context was stored both in __py_context & bpy_context_module.
This avoids duplicate functions to update them too.
Diffstat (limited to 'source/blender/python/intern/bpy.c')
-rw-r--r-- | source/blender/python/intern/bpy.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 75314e4e2ea..804a28d0ebc 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -349,7 +349,7 @@ static PyObject *bpy_import_test(const char *modname) /****************************************************************************** * Description: Creates the bpy module and adds it to sys.modules for importing ******************************************************************************/ -void BPy_init_modules(void) +void BPy_init_modules(struct bContext *C) { PointerRNA ctx_ptr; PyObject *mod; @@ -400,8 +400,7 @@ void BPy_init_modules(void) PyModule_AddObject(mod, "_utils_previews", BPY_utils_previews_module()); PyModule_AddObject(mod, "msgbus", BPY_msgbus_module()); - /* bpy context */ - RNA_pointer_create(NULL, &RNA_Context, (void *)BPy_GetContext(), &ctx_ptr); + RNA_pointer_create(NULL, &RNA_Context, C, &ctx_ptr); bpy_context_module = (BPy_StructRNA *)pyrna_struct_CreatePyObject(&ctx_ptr); /* odd that this is needed, 1 ref on creation and another for the module * but without we get a crash on exit */ |