Fix #27594: non-active object in weight paint mode doesn't free memory.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 13 Jun 2011 12:03:13 +0000 (12:03 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 13 Jun 2011 12:03:13 +0000 (12:03 +0000)
Also removed some commented out 2.4x code that is already replaced.

source/blender/editors/util/ed_util.c
source/blender/windowmanager/intern/wm_init_exit.c

index 705fb83264c62beaeb6173734b4bfa1f4125f0c3..3dd7514429ed56e54410c2cb2dd8feb4ed10de1f 100644 (file)
@@ -106,10 +106,6 @@ void ED_editors_exit(bContext *C)
                if(sce->obedit) {
                        Object *ob= sce->obedit;
                
-                       /* global in meshtools... */
-                       mesh_octree_table(NULL, NULL, NULL, 'e');
-                       mesh_mirrtopo_table(NULL, 'e');
-                       
                        if(ob) {
                                if(ob->type==OB_MESH) {
                                        Mesh *me= ob->data;
@@ -122,26 +118,13 @@ void ED_editors_exit(bContext *C)
                                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();         // XXX this is still a global...
-                       }
-               }
-               else if(sce->basact && sce->basact->object) {
-                       Object *ob= sce->basact->object;
-                       
-                       /* if weight-painting is on, free mesh octree data */
-                       if(ob->mode & OB_MODE_WEIGHT_PAINT) {
-                               mesh_octree_table(NULL, NULL, NULL, 'e');
-                               mesh_mirrtopo_table(NULL, 'e');
                        }
                }
        }
-       
+
+       /* global in meshtools... */
+       mesh_octree_table(NULL, NULL, NULL, 'e');
+       mesh_mirrtopo_table(NULL, 'e');
 }
 
 
index 2e4148ca51d1d8bd42238996db8eaa0c0d080bc2..d57c94a582614f7a2097be27692e64e5b59dffe6 100644 (file)
@@ -328,7 +328,6 @@ static void free_openrecent(void)
 
 /* bad stuff*/
 
-extern ListBase editelems;
 extern wchar_t *copybuf;
 extern wchar_t *copybufinfo;
 
@@ -394,10 +393,6 @@ void WM_exit(bContext *C)
        free_anim_drivers_copybuf();
        free_fmodifiers_copybuf();
        free_posebuf();
-//     free_vertexpaint();
-//     free_imagepaint();
-       
-//     fsmenu_free();
 
        BLF_exit();
        
@@ -420,10 +415,6 @@ void WM_exit(bContext *C)
        BPY_python_end();
 #endif
 
-       if (!G.background) {
-// XXX         UI_filelist_free_icons();
-       }
-       
        GPU_buffer_pool_free(NULL);
        GPU_free_unused_buffers();
        GPU_extensions_exit();