Py/RNA API test code to prevent crashing blender when python references freed ID's.

This uses pythons GC so its no overhead during runtime but makes removing ID's slower.

Commented definition 'USE_PYRNA_INVALIDATE_GC' for now, so no functional change.
This commit is contained in:
2011-03-01 09:02:54 +00:00
parent c8de6195c8
commit c9ee017fb5
4 changed files with 57 additions and 7 deletions

View File

@@ -44,6 +44,9 @@ extern PyTypeObject pyrna_prop_collection_Type;
#define BPy_PropertyRNA_Check(v) (PyObject_TypeCheck(v, &pyrna_prop_Type))
#define BPy_PropertyRNA_CheckExact(v) (Py_TYPE(v) == &pyrna_prop_Type)
/* method to invalidate removed py data, XXX, slow to remove objects, otherwise no overhead */
// #define USE_PYRNA_INVALIDATE_GC
/* play it safe and keep optional for now, need to test further now this affects looping on 10000's of verts for eg. */
// #define USE_WEAKREFS