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.
This commit is contained in:
2017-08-01 17:15:50 +10:00
parent 5ac9e587d4
commit 5709021f52

View File

@@ -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
}
}