[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26397] trunk/blender/source/blender/ python/intern: Fix the underlying problem from the last commit, which was worked

Brecht Van Lommel brecht at blender.org
Fri Jan 29 15:49:23 CET 2010


Revision: 26397
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26397
Author:   blendix
Date:     2010-01-29 15:49:21 +0100 (Fri, 29 Jan 2010)

Log Message:
-----------
Fix the underlying problem from the last commit, which was worked
around incorrectly in r24435 before that. freeptr in BPy_StructRNA
was uninitialized when creating bpy.context.

Modified Paths:
--------------
    trunk/blender/source/blender/python/intern/bpy_interface.c
    trunk/blender/source/blender/python/intern/bpy_rna.c

Modified: trunk/blender/source/blender/python/intern/bpy_interface.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_interface.c	2010-01-29 14:13:40 UTC (rev 26396)
+++ trunk/blender/source/blender/python/intern/bpy_interface.c	2010-01-29 14:49:21 UTC (rev 26397)
@@ -217,7 +217,9 @@
 	/* 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);
 	}

Modified: trunk/blender/source/blender/python/intern/bpy_rna.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_rna.c	2010-01-29 14:13:40 UTC (rev 26396)
+++ trunk/blender/source/blender/python/intern/bpy_rna.c	2010-01-29 14:49:21 UTC (rev 26397)
@@ -370,13 +370,9 @@
 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 */





More information about the Bf-blender-cvs mailing list