From cc59abb1247c496ed80611c5ed30c9f662eecb0f Mon Sep 17 00:00:00 2001 From: columbarius Date: Tue, 18 Aug 2020 09:24:13 +0200 Subject: [PATCH] Remove unnecessary check from wlr_screencast.c --- src/screencast/wlr_screencast.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/screencast/wlr_screencast.c b/src/screencast/wlr_screencast.c index 53bafaf..3dc5444 100644 --- a/src/screencast/wlr_screencast.c +++ b/src/screencast/wlr_screencast.c @@ -20,12 +20,9 @@ #include "logger.h" static void wlr_frame_buffer_destroy(struct xdpw_screencast_instance *cast) { - // This check isn't needed - if (cast->simple_frame.data != NULL) { - munmap(cast->simple_frame.data, cast->simple_frame.size); - cast->simple_frame.data = NULL; - } - // This one is + munmap(cast->simple_frame.data, cast->simple_frame.size); + cast->simple_frame.data = NULL; + // wl_buffer_destroy won't work on NULL if (cast->simple_frame.buffer != NULL) { wl_buffer_destroy(cast->simple_frame.buffer); cast->simple_frame.buffer = NULL;