[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56201] trunk/blender/source/blender/ blenloader/intern/readfile.c: Fix #35037: Compositor: MultilayerEXR + undo loses image.

Sergey Sharybin sergey.vfx at gmail.com
Mon Apr 22 12:09:01 CEST 2013


Revision: 56201
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56201
Author:   nazgul
Date:     2013-04-22 10:08:58 +0000 (Mon, 22 Apr 2013)
Log Message:
-----------
Fix #35037: Compositor: MultilayerEXR + undo loses image. Crash when selecting in Image Editor

Issue was cause dby ima->ibufs being stored in a ma on
undo/redo and ima->rr not. In case of multilayer image
ibufs hares pointer with render result, so current
undo/redo policy lead to a dead pointer stored in ibuf.

Made it so ima->rr also stores in the map and restores
on redo/undo keeping all the pointers fine.

Modified Paths:
--------------
    trunk/blender/source/blender/blenloader/intern/readfile.c

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2013-04-22 09:26:02 UTC (rev 56200)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2013-04-22 10:08:58 UTC (rev 56201)
@@ -1315,6 +1315,8 @@
 			oldnewmap_insert(fd->imamap, ibuf, ibuf, 0);
 		if (ima->gputexture)
 			oldnewmap_insert(fd->imamap, ima->gputexture, ima->gputexture, 0);
+		if (ima->rr)
+			oldnewmap_insert(fd->imamap, ima->rr, ima->rr, 0);
 		for (a=0; a < IMA_MAX_RENDER_SLOT; a++)
 			if (ima->renders[a])
 				oldnewmap_insert(fd->imamap, ima->renders[a], ima->renders[a], 0);
@@ -1356,12 +1358,14 @@
 				ima->bindcode = 0;
 				ima->tpageflag &= ~IMA_GLBIND_IS_DATA;
 				ima->gputexture = NULL;
+				ima->rr = NULL;
 			}
 		}
 		for (i = 0; i < IMA_MAX_RENDER_SLOT; i++)
 			ima->renders[i] = newimaadr(fd, ima->renders[i]);
 		
 		ima->gputexture = newimaadr(fd, ima->gputexture);
+		ima->rr = newimaadr(fd, ima->rr);
 	}
 	for (; sce; sce = sce->id.next) {
 		if (sce->nodetree && sce->nodetree->previews) {
@@ -3278,10 +3282,10 @@
 		ima->bindcode = 0;
 		ima->tpageflag &= ~IMA_GLBIND_IS_DATA;
 		ima->gputexture = NULL;
+		ima->rr = NULL;
 	}
 	
 	ima->anim = NULL;
-	ima->rr = NULL;
 	ima->repbind = NULL;
 	
 	/* undo system, try to restore render buffers */




More information about the Bf-blender-cvs mailing list