Blender Git Commit Log

Git Commits -> Revision f4e5404

Revision f4e5404 by Campbell Barton (master)
November 1, 2012, 15:56 (GMT)
fix for long standing problem with blender 2.5x py api.
Removing data then accessing would allow invalid memory access and often crash.

Example:
import bpy
image = bpy.data.images.new(name="a", width=5, height=5)
bpy.data.images.remove(image)
print(image.name)

Now access to the removed data raises an error:
ReferenceError: StructRNA of type Image has been removed

This is the same level of error checking that was done in blender 2.4x but was made difficult by RNA functions not having access to the PyObject's.

Commit Details:

Full Hash: f4e5404e4ae1bf0c5c45220f87e981fbc4c3ab98
SVN Revision: 51809
Parent Commit: 818e9ff
Lines Changed: +57, -17

5 Modified Paths:

/source/blender/makesrna/intern/makesrna.c (+6, -0) (Diff)
/source/blender/makesrna/intern/rna_define.c (+19, -5) (Diff)
/source/blender/makesrna/intern/rna_main_api.c (+9, -6) (Diff)
/source/blender/makesrna/RNA_access.h (+7, -0) (Diff)
/source/blender/python/intern/bpy_rna.c (+16, -6) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021