fix for accessing invalid memory when loading a new file.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 25 Dec 2009 23:50:35 +0000 (23:50 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 25 Dec 2009 23:50:35 +0000 (23:50 +0000)
source/blender/blenkernel/intern/scene.c

index 0a2edf82cb03eebeb82cef53258b3cf6a4f9354d..eadeac585b2917b7ad8ef1bf7b1d2e482a29c6ed 100644 (file)
@@ -249,7 +249,12 @@ void free_scene(Scene *sce)
        /* do not free objects! */
        
        if(sce->gpd) {
+#if 0   // removed since this can be invalid memory when freeing everything
+        // since the grease pencil data is free'd before the scene.
+        // since grease pencil data is not (yet?), shared between objects
+        // its probably safe not to do this, some save and reload will free this.
                sce->gpd->id.us--;
+#endif
                sce->gpd= NULL;
        }