From 863e2c82ecf81cb1a7dadbf612441a7805bdf919 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Thu, 13 Jun 2019 08:14:14 +0100 Subject: [PATCH] new backends: don't destroy blur context when there's none Fixes #190 Signed-off-by: Yuxuan Shui --- src/compton.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/compton.c b/src/compton.c index cdd53d7..93d4f4b 100644 --- a/src/compton.c +++ b/src/compton.c @@ -666,9 +666,11 @@ static void destroy_backend(session_t *ps) { if (ps->backend_data) { // deinit backend - ps->backend_data->ops->destroy_blur_context(ps->backend_data, - ps->backend_blur_context); - ps->backend_blur_context = NULL; + if (ps->backend_blur_context) { + ps->backend_data->ops->destroy_blur_context( + ps->backend_data, ps->backend_blur_context); + ps->backend_blur_context = NULL; + } ps->backend_data->ops->deinit(ps->backend_data); ps->backend_data = NULL; }