diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-07-23 05:43:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-07-23 05:43:30 +0400 |
commit | 026ac2492232fac4fb7350ff210ba34b353a84e2 (patch) | |
tree | 0667dafd2dc948c93e6ac7b5be42d80045bd2f6f /source/blender/editors/animation/keyingsets.c | |
parent | 43d5357a2e0dc2be209bdcbdf63246002dda4a7f (diff) |
[#22488] Reloading scripts causes crash
F8 key enabled again, useful for script UI development.
- keying set freeing wasnt freeing from all scenes and the builtin list.
- PointerProperty() cant refer to a removed python srna type (fixed in rigify and netrender).
- Added a check for freeing a type used by a PointerProperty but its very slow, makes reloading take ~10sec. Only enabled this in debug mode for now.
Netrender register() function isnt re-registering the property, probably because the module is cached by python and not re-run.
Diffstat (limited to 'source/blender/editors/animation/keyingsets.c')
-rw-r--r-- | source/blender/editors/animation/keyingsets.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 1c06266a148..301111d22fd 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -43,6 +43,7 @@ #include "DNA_constraint_types.h" #include "DNA_scene_types.h" +#include "BKE_main.h" #include "BKE_animsys.h" #include "BKE_action.h" #include "BKE_context.h" @@ -589,7 +590,7 @@ void ANIM_keyingset_info_register (const bContext *C, KeyingSetInfo *ksi) /* Remove the given KeyingSetInfo from the list of type infos, and also remove the builtin set if appropriate */ void ANIM_keyingset_info_unregister (const bContext *C, KeyingSetInfo *ksi) { - Scene *scene = CTX_data_scene(C); + Main *bmain= CTX_data_main(C); KeyingSet *ks, *ksn; /* find relevant builtin KeyingSets which use this, and remove them */ @@ -600,8 +601,14 @@ void ANIM_keyingset_info_unregister (const bContext *C, KeyingSetInfo *ksi) /* remove if matching typeinfo name */ if (strcmp(ks->typeinfo, ksi->idname) == 0) { + Scene *scene; BKE_keyingset_free(ks); - BLI_freelinkN(&scene->keyingsets, ks); + BLI_remlink(&builtin_keyingsets, ks); + + for(scene= bmain->scene.first; scene; scene= scene->id.next) + BLI_remlink_safe(&scene->keyingsets, ks); + + MEM_freeN(ks); } } |