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:
2008-02-16 16:35:47 +00:00
parent 97a28c52b4
commit b7af3d2cbd
4 changed files with 83 additions and 84 deletions

View File

@@ -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()-----------------------------*/