Correction to previous fix of multiple releases of same ImBuf
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 1 Feb 2016 16:10:40 +0000 (17:10 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 1 Feb 2016 16:12:09 +0000 (17:12 +0100)
Original change in d631252 was not quite correct because it
was missing release since the acquire() will return NULL.

Hopefully now all the cases are covered.

source/blender/editors/space_image/image_edit.c

index e48f4e24c34ee3ecea2d2f27b78363d4d083f745..ffbbcd6d72272cd962d25ae0d48797fc57516b65 100644 (file)
@@ -119,6 +119,8 @@ ImBuf *ED_space_image_acquire_buffer(SpaceImage *sima, void **r_lock)
                if (ibuf) {
                        if (ibuf->rect || ibuf->rect_float)
                                return ibuf;
                if (ibuf) {
                        if (ibuf->rect || ibuf->rect_float)
                                return ibuf;
+                       BKE_image_release_ibuf(sima->image, ibuf, *r_lock);
+                       *r_lock = NULL;
                }
        }
        else
                }
        }
        else