[Bf-blender-cvs] [3c3d0898b0c] master: PyAPI: Fix mathutils freeze allowing owned data

Campbell Barton noreply at git.blender.org
Sat Sep 9 03:02:23 CEST 2017


Commit: 3c3d0898b0c1a1d7da70f4a1778d4360b3cfe5c8
Author: Campbell Barton
Date:   Sat Sep 9 11:08:38 2017 +1000
Branches: master
https://developer.blender.org/rB3c3d0898b0c1a1d7da70f4a1778d4360b3cfe5c8

PyAPI: Fix mathutils freeze allowing owned data

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

M	source/blender/python/mathutils/mathutils.c

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

diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c
index 1afb1d7be90..96ae0a9e50f 100644
--- a/source/blender/python/mathutils/mathutils.c
+++ b/source/blender/python/mathutils/mathutils.c
@@ -554,8 +554,8 @@ char BaseMathObject_freeze_doc[] =
 ;
 PyObject *BaseMathObject_freeze(BaseMathObject *self)
 {
-	if (self->flag & BASE_MATH_FLAG_IS_WRAP) {
-		PyErr_SetString(PyExc_TypeError, "Cannot freeze wrapped data");
+	if ((self->flag & BASE_MATH_FLAG_IS_WRAP) || (self->cb_user != NULL)) {
+		PyErr_SetString(PyExc_TypeError, "Cannot freeze wrapped/owned data");
 		return NULL;
 	}



More information about the Bf-blender-cvs mailing list