Fixed memory leak when dmabuf importing is used
1 files changed, 5 insertions(+), 4 deletions(-)

M src/dmabuf_source.c
M src/dmabuf_source.c +5 -4
@@ 283,11 283,12 @@ static void ready(void* data, struct zwl
 	}
 
 	if(this->current_frame != NULL) {
-		if(this->current_frame->img != NULL) {
+		if(this->current_frame->texture != NULL) {
 			gs_texture_destroy(this->current_frame->texture);
-			if(this->current_frame->img != NULL) {
-				eglDestroyImage(eglGetCurrentDisplay(), this->current_frame->img);
-			}
+		}
+
+		if(this->current_frame->img != NULL) {
+			eglDestroyImage(eglGetCurrentDisplay(), this->current_frame->img);
 		}
 
 		if(this->current_frame->frame != NULL) {