diff options
author | Ton Roosendaal <ton@blender.org> | 2009-04-30 16:51:38 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-04-30 16:51:38 +0400 |
commit | 140a60539bb03d4f843e6d6f5aa47e7d726b0971 (patch) | |
tree | 256dc001a66fe2f39f72928b69a86de2e1a19c9d /source/blender/editors/util | |
parent | 3c9e3e69ed778b817975e91c4ea22ea94ffd094e (diff) |
2.5
Bug reported by Joshua: quitting Blender via window header quit widget
didn't free editmode stuff.
Diffstat (limited to 'source/blender/editors/util')
-rw-r--r-- | source/blender/editors/util/ed_util.c | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 5623e538eb4..ae1e932bb81 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -42,6 +42,7 @@ #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_main.h" #include "ED_armature.h" #include "ED_mesh.h" @@ -52,39 +53,45 @@ /* ********* general editor util funcs, not BKE stuff please! ********* */ +/* frees all editmode stuff */ void ED_editors_exit(bContext *C) { - Object *ob= CTX_data_edit_object(C); + Scene *sce; /* frees all editmode undos */ undo_editmode_clear(); undo_imagepaint_clear(); - /* global in meshtools... */ - mesh_octree_table(ob, NULL, NULL, 'e'); - - if(ob) { - if(ob->type==OB_MESH) { - Mesh *me= ob->data; - if(me->edit_mesh) { - free_editMesh(me->edit_mesh); - MEM_freeN(me->edit_mesh); - me->edit_mesh= NULL; + for(sce=G.main->scene.first; sce; sce= sce->id.next) { + if(sce->obedit) { + Object *ob= sce->obedit; + + /* global in meshtools... */ + mesh_octree_table(ob, NULL, NULL, 'e'); + + if(ob) { + if(ob->type==OB_MESH) { + Mesh *me= ob->data; + if(me->edit_mesh) { + free_editMesh(me->edit_mesh); + MEM_freeN(me->edit_mesh); + me->edit_mesh= NULL; + } + } + else if(ob->type==OB_ARMATURE) { + ED_armature_edit_free(ob); + } + else if(ob->type==OB_FONT) { + // free_editText(); + } + // else if(ob->type==OB_MBALL) + // BLI_freelistN(&editelems); + // free_editLatt(); + // free_posebuf(); } } - else if(ob->type==OB_ARMATURE) { - ED_armature_edit_free(ob); - } - else if(ob->type==OB_FONT) { - // free_editText(); - } - // else if(ob->type==OB_MBALL) - // BLI_freelistN(&editelems); } - // free_editLatt(); - // free_posebuf(); - } |