svn merge ^/trunk/blender -r48288:48302
[blender.git] / source / blender / compositor / operations / COM_ViewerBaseOperation.cpp
index 446b169763c380e038d59abe0677e51df9c566bc..141e8d0eeff871ec5b37521279439b7607ee0786 100644 (file)
@@ -71,7 +71,9 @@ void ViewerBaseOperation::initImage()
                imb_addrectfloatImBuf(ibuf);
                anImage->ok = IMA_OK_LOADED;
        }
-       
+
+       imb_freerectviewImBuf_all(ibuf);
+
        /* now we combine the input with ibuf */
        this->m_outputBuffer = ibuf->rect_float;
        this->m_outputBufferDisplay = (unsigned char *)ibuf->rect;
@@ -85,6 +87,10 @@ void ViewerBaseOperation:: updateImage(rcti *rect)
 
 void ViewerBaseOperation::deinitExecution()
 {
+       ImBuf *ibuf = BKE_image_acquire_ibuf(this->m_image, this->m_imageUser, &this->m_lock);
+       imb_freerectviewImBuf_all(ibuf);
+       BKE_image_release_ibuf(this->m_image, this->m_lock);
+
        this->m_outputBuffer = NULL;
 }