diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-02-16 19:35:47 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-02-16 19:35:47 +0300 |
commit | b7af3d2cbd8dc39e1d133f9c7251cb70cf1aa75b (patch) | |
tree | 005fbfa62faf9a152c7975c1f52ac2cd662ee5f1 /source/blender/python/api2_2x/Scene.c | |
parent | 97a28c52b488f8385598d67be9b7e8a1eee66b26 (diff) |
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.
Diffstat (limited to 'source/blender/python/api2_2x/Scene.c')
-rw-r--r-- | source/blender/python/api2_2x/Scene.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/python/api2_2x/Scene.c b/source/blender/python/api2_2x/Scene.c index 397cee0ad5e..38903a74d7d 100644 --- a/source/blender/python/api2_2x/Scene.c +++ b/source/blender/python/api2_2x/Scene.c @@ -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()-----------------------------*/ |