Revision: 27799
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27799
Author:   blendix
Date:     2010-03-28 15:45:19 +0200 (Sun, 28 Mar 2010)

Log Message:
-----------
Attempt to fix #21796: render crash on windows after slots commit.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/image.c
    trunk/blender/source/blender/editors/render/render_internal.c
    trunk/blender/source/blender/editors/space_image/image_draw.c

Modified: trunk/blender/source/blender/blenkernel/intern/image.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/image.c      2010-03-28 
10:52:24 UTC (rev 27798)
+++ trunk/blender/source/blender/blenkernel/intern/image.c      2010-03-28 
13:45:19 UTC (rev 27799)
@@ -1948,8 +1948,11 @@
        ibuf->x= rres.rectx;
        ibuf->y= rres.recty;
        
-       if(ibuf->rect_float!=rectf || rect) /* ensure correct redraw */
+       if(ibuf->rect_float!=rectf || rect) { /* ensure correct redraw */
+               BLI_lock_thread(LOCK_CUSTOM1);
                imb_freerectImBuf(ibuf);
+               BLI_unlock_thread(LOCK_CUSTOM1);
+       }
        if(rect)
                ibuf->rect= rect;
        

Modified: trunk/blender/source/blender/editors/render/render_internal.c
===================================================================
--- trunk/blender/source/blender/editors/render/render_internal.c       
2010-03-28 10:52:24 UTC (rev 27798)
+++ trunk/blender/source/blender/editors/render/render_internal.c       
2010-03-28 13:45:19 UTC (rev 27799)
@@ -30,30 +30,24 @@
 
 #include "MEM_guardedalloc.h"
 
-#include "BLI_math.h"
 #include "BLI_blenlib.h"
-#include "BLI_editVert.h"
-#include "BLI_dlrbTree.h"
+#include "BLI_math.h"
+#include "BLI_threads.h"
 
 #include "DNA_scene_types.h"
 
 #include "BKE_blender.h"
 #include "BKE_colortools.h"
 #include "BKE_context.h"
-#include "BKE_customdata.h"
 #include "BKE_global.h"
 #include "BKE_image.h"
-#include "BKE_idprop.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
-#include "BKE_mesh.h"
 #include "BKE_multires.h"
 #include "BKE_report.h"
 #include "BKE_scene.h"
 #include "BKE_screen.h"
 #include "BKE_utildefines.h"
-#include "BKE_sound.h"
-#include "BKE_writeavi.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -68,7 +62,6 @@
 #include "RNA_access.h"
 #include "RNA_define.h"
 
-
 #include "wm_window.h"
 
 #include "render_intern.h"
@@ -136,8 +129,12 @@
        }
        if(rectf==NULL) return;
 
-       if(ibuf->rect==NULL)
-               imb_addrectImBuf(ibuf);
+       if(ibuf->rect==NULL) {
+               BLI_lock_thread(LOCK_CUSTOM1);
+               if(ibuf->rect==NULL)
+                       imb_addrectImBuf(ibuf);
+               BLI_unlock_thread(LOCK_CUSTOM1);
+       }
 
        rectf+= 4*(rr->rectx*ymin + xmin);
        rectc= (char *)(ibuf->rect + ibuf->x*rymin + rxmin);

Modified: trunk/blender/source/blender/editors/space_image/image_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_draw.c       
2010-03-28 10:52:24 UTC (rev 27798)
+++ trunk/blender/source/blender/editors/space_image/image_draw.c       
2010-03-28 13:45:19 UTC (rev 27799)
@@ -38,6 +38,7 @@
 #include "DNA_screen_types.h"
 
 #include "PIL_time.h"
+#include "BLI_threads.h"
 
 #include "IMB_imbuf.h"
 #include "IMB_imbuf_types.h"
@@ -75,16 +76,19 @@
           NOTE: if float buffer changes, we have to manually remove the rect
        */
 
-       if(ibuf->rect_float) {
-               if(ibuf->rect==NULL) {
-                       if (color_manage) {
-                                       if (ima && ima->source == 
IMA_SRC_VIEWER)
+       if(ibuf->rect_float && ibuf->rect==NULL) {
+               BLI_lock_thread(LOCK_CUSTOM1);
+               if(ibuf->rect_float && ibuf->rect==NULL) {
+                       if(color_manage) {
+                                       if(ima && ima->source == IMA_SRC_VIEWER)
                                                ibuf->profile = 
IB_PROFILE_LINEAR_RGB;
-                       } else {
+                       }
+                       else
                                ibuf->profile = IB_PROFILE_NONE;
-                       }
+
                        IMB_rect_from_float(ibuf);
                }
+               BLI_unlock_thread(LOCK_CUSTOM1);
        }
 }
 


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to