diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 1591f491944..58f271a5e77 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -217,7 +217,9 @@ static void bpy_init_modules( void ) /* bpy context */ { bpy_context_module= ( BPy_StructRNA * ) PyObject_NEW( BPy_StructRNA, &pyrna_struct_Type ); + RNA_pointer_create(NULL, &RNA_Context, NULL, &bpy_context_module->ptr); + bpy_context_module->freeptr= 0; PyModule_AddObject(mod, "context", (PyObject *)bpy_context_module); } diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 9e34da1dde7..49dfa95109c 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -370,13 +370,9 @@ static long pyrna_struct_hash( BPy_StructRNA *self ) static void pyrna_struct_dealloc( BPy_StructRNA *self ) { if (self->freeptr && self->ptr.data) { - - if (self->ptr.type != &RNA_Context) - { - IDP_FreeProperty(self->ptr.data); - MEM_freeN(self->ptr.data); - self->ptr.data= NULL; - } + IDP_FreeProperty(self->ptr.data); + MEM_freeN(self->ptr.data); + self->ptr.data= NULL; } /* Note, for subclassed PyObjects we cant just call PyObject_DEL() directly or it will crash */ |