From 159a45b9e91032667d93d4af960da875ce99ced9 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Thu, 25 Jul 2019 21:25:43 +0100 Subject: [PATCH] core: root_image freeing shouldn't be in a loop --- src/compton.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compton.c b/src/compton.c index 7b36e10..3975e0c 100644 --- a/src/compton.c +++ b/src/compton.c @@ -660,15 +660,15 @@ static void destroy_backend(session_t *ps) { assert(!w->win_image); assert(!w->shadow_image); } - if (ps->root_image) { - ps->backend_data->ops->release_image(ps->backend_data, - ps->root_image); - ps->root_image = NULL; - } } free_paint(ps, &w->paint); } + if (ps->backend_data && ps->root_image) { + ps->backend_data->ops->release_image(ps->backend_data, ps->root_image); + ps->root_image = NULL; + } + if (ps->backend_data) { // deinit backend if (ps->backend_blur_context) {