Bugfix #5305
authorTon Roosendaal <ton@blender.org>
Sat, 25 Nov 2006 18:40:53 +0000 (18:40 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 25 Nov 2006 18:40:53 +0000 (18:40 +0000)
Sculpt mode crasher; after deleting object and quitting blender. Was freed
memory hanging in sculpt undo data.

source/blender/src/editobject.c
source/blender/src/sculptmode.c

index 665a67d5399814d72d077584b261c742f2c958a1..26f248628fe17e964351ea124619329aa8c5ce43 100644 (file)
@@ -260,10 +260,6 @@ void delete_obj(int ok)
        Base *base;
        int islamp= 0;
        
        Base *base;
        int islamp= 0;
        
-       /* used for global delete only*/
-       Scene *scene; 
-       Base *base_other;
-       
        if(G.obedit) return;
        if(G.scene->id.lib) return;
 
        if(G.obedit) return;
        if(G.scene->id.lib) return;
 
@@ -290,6 +286,9 @@ void delete_obj(int ok)
                        if(base->object->vnode) b_verse_delete_object(base->object);
 #endif
                        if (ok==2) {
                        if(base->object->vnode) b_verse_delete_object(base->object);
 #endif
                        if (ok==2) {
+                               Scene *scene; 
+                               Base *base_other;
+                               
                                for (scene= G.main->scene.first; scene; scene= scene->id.next) {
                                        if (scene != G.scene && !(scene->id.lib)) {
                                                base_other= object_in_scene( base->object, scene );
                                for (scene= G.main->scene.first; scene; scene= scene->id.next) {
                                        if (scene != G.scene && !(scene->id.lib)) {
                                                base_other= object_in_scene( base->object, scene );
index e135c79c59edf4a92f6df194669b3d89370fa94b..8d6ec00159356528f697868f0953e1cb2df4b7f5 100644 (file)
@@ -296,6 +296,7 @@ void sculptmode_undo_free(Scene *sce)
                sculptmode_undo_free_link(sus);
        BLI_freelistN(&sce->sculptdata.undo->steps);
        MEM_freeN(sce->sculptdata.undo);
                sculptmode_undo_free_link(sus);
        BLI_freelistN(&sce->sculptdata.undo->steps);
        MEM_freeN(sce->sculptdata.undo);
+       sce->sculptdata.undo= NULL;
 }
 
 void sculptmode_undo_push(char *str, SculptUndoType type)
 }
 
 void sculptmode_undo_push(char *str, SculptUndoType type)