fix for [#8257] double-freeing pointers from sculpt code
http://projects.blender.org/tracker/index.php?func=detail&aid=8257&group_id=9&atid=125 Cleaned up scene_copy, and moved some scene copying into this function that was inline in the user interface. Also moved malloc error prints onto separate lines so you can set breakpoints.
This commit is contained in:
@@ -774,16 +774,16 @@ static PyObject *Scene_oldsetLayers( BPy_Scene * self, PyObject * args )
|
||||
/*-----------------------Scene.copy()------------------------------------*/
|
||||
static PyObject *Scene_copy( BPy_Scene * self, PyObject * args )
|
||||
{
|
||||
short dup_objs = 1;
|
||||
short dup_objs = 2;
|
||||
Scene *scene = self->scene;
|
||||
|
||||
SCENE_DEL_CHECK_PY(self);
|
||||
|
||||
if( !PyArg_ParseTuple( args, "|h", &dup_objs ) )
|
||||
if( !PyArg_ParseTuple( args, "|h", &dup_objs ) || dup_objs < 0 || dup_objs > 2)
|
||||
return EXPP_ReturnPyObjError( PyExc_TypeError,
|
||||
"expected int in [0,2] or nothing as argument" );
|
||||
|
||||
return Scene_CreatePyObject( copy_scene( scene, dup_objs ) );
|
||||
|
||||
return Scene_CreatePyObject( copy_scene( scene, dup_objs+1 ) );
|
||||
}
|
||||
|
||||
/*-----------------------Scene.makeCurrent()-----------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user