diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-22 12:41:59 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-22 12:51:03 +0300 |
commit | cf6002737da7a842650d47569385467f4812cb78 (patch) | |
tree | a92eff609b5fb7f5a7d1c095b9124d38850f2b62 /source/blender/python | |
parent | 3dd8f287e1fd0993eef8cac782c30a264ebb0d71 (diff) |
Don't make Python classes of StructRNA on startup
This gives small start time speedup, classes are lazy loaded instead.
Keep existing behavior in debug builds to catch any errors early.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index d15e3b36ced..af4b239d6e1 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -7446,8 +7446,14 @@ static void bpy_class_free(void *pyob_ptr) PyGILState_Release(gilstate); } +/** + * \note This isn't essential to run on startup, since subtypes will lazy initialize. + * But keep running in debug mode so we get immediate notification of bad class hierarchy + * or any errors in "bpy_types.py" at load time, so errors don't go unnoticed. + */ void pyrna_alloc_types(void) { +#ifdef DEBUG PyGILState_STATE gilstate; PointerRNA ptr; @@ -7475,6 +7481,7 @@ void pyrna_alloc_types(void) RNA_PROP_END; PyGILState_Release(gilstate); +#endif /* DEBUG */ } |