[Bf-blender-cvs] [5709021f52d] blender2.8: Correct previous commit, instance should be cleared

Campbell Barton noreply at git.blender.org
Tue Aug 1 09:03:56 CEST 2017


Commit: 5709021f52d9bb3eaa5f9fc4c11c6d2d96bb60c9
Author: Campbell Barton
Date:   Tue Aug 1 17:15:50 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB5709021f52d9bb3eaa5f9fc4c11c6d2d96bb60c9

Correct previous commit, instance should be cleared

Clear instance in case creating creating new instance fails.

In practice this shouldn't happen,
but better not cause further errors if it does.

===================================================================

M	source/blender/python/intern/bpy_rna.c

===================================================================

diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index b9f80b79dde..e08f1bca10c 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -6672,9 +6672,10 @@ PyObject *pyrna_struct_CreatePyObject(PointerRNA *ptr)
 		else {
 			/* Existing users will need to use 'type_recast' method. */
 			Py_DECREF(pyrna);
+			*instance = NULL;
 			/* Continue as if no instance was made */
 #if 0		/* no need to assign, will be written to next... */
-			*instance = pyrna = NULL;
+			pyrna = NULL;
 #endif
 		}
 	}




More information about the Bf-blender-cvs mailing list