[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [10781] trunk/blender/source/blender/ python/api2_2x/Armature.c: Fix segfault in PyBonesDict_FromPyArmature() caused by uninitialized memory.

Campbell Barton cbarton at metavr.com
Sat May 26 02:38:10 CEST 2007


Sorry about that, I found it very late last night and was going to find 
out what the problem was this morning...

Also found some more memory leaks, todo with PyBuild_Value


Ken Hughes wrote:
> Revision: 10781
>           http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bforge-svn&revision=10781
> Author:   khughes
> Date:     2007-05-25 22:54:48 +0200 (Fri, 25 May 2007)
> 
> Log Message:
> -----------
> Fix segfault in PyBonesDict_FromPyArmature() caused by uninitialized memory.
> 
> Modified Paths:
> --------------
>     trunk/blender/source/blender/python/api2_2x/Armature.c
> 
> Modified: trunk/blender/source/blender/python/api2_2x/Armature.c
> ===================================================================
> --- trunk/blender/source/blender/python/api2_2x/Armature.c	2007-05-25 17:32:41 UTC (rev 10780)
> +++ trunk/blender/source/blender/python/api2_2x/Armature.c	2007-05-25 20:54:48 UTC (rev 10781)
> @@ -428,6 +428,9 @@
>  	if (!py_BonesDict)
>  		goto RuntimeError;
>  
> +	py_BonesDict->bones = NULL;
> +	py_BonesDict->editbones.first = py_BonesDict->editbones.last = NULL;
> +
>  	//create internal dictionaries
>  	py_BonesDict->bonesMap = PyDict_New();
>  	py_BonesDict->editbonesMap = PyDict_New();
> @@ -1294,7 +1297,7 @@
>   * Converts a bArmature to a PyArmature
>   * 
>   * WARNING!!! - MEMORY LEAK HERE, Run in a loop and loose your ram.
> - * cannot find out why but dosnt seam to be the weakref */
> + * cannot find out why but doesn't seem to be the weakref */
>  
>  PyObject *Armature_CreatePyObject(struct bArmature *armature)
>  {
> 
> 
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
> 
> 
> 
> 
> 


-- 
See MetaVR Visuals Used at the Combat Studies Institute
http://www.metavr.com/casestudies/baghdadviews.html

Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241

!DSPAM:18,465783db36378044114157!




More information about the Bf-committers mailing list