mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-22 14:35:57 +01:00
Remove unnecessary check from wlr_screencast.c
This commit is contained in:
parent
5ea10ef253
commit
cc59abb124
1 changed files with 3 additions and 6 deletions
|
@ -20,12 +20,9 @@
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
|
|
||||||
static void wlr_frame_buffer_destroy(struct xdpw_screencast_instance *cast) {
|
static void wlr_frame_buffer_destroy(struct xdpw_screencast_instance *cast) {
|
||||||
// This check isn't needed
|
munmap(cast->simple_frame.data, cast->simple_frame.size);
|
||||||
if (cast->simple_frame.data != NULL) {
|
cast->simple_frame.data = NULL;
|
||||||
munmap(cast->simple_frame.data, cast->simple_frame.size);
|
// wl_buffer_destroy won't work on NULL
|
||||||
cast->simple_frame.data = NULL;
|
|
||||||
}
|
|
||||||
// This one is
|
|
||||||
if (cast->simple_frame.buffer != NULL) {
|
if (cast->simple_frame.buffer != NULL) {
|
||||||
wl_buffer_destroy(cast->simple_frame.buffer);
|
wl_buffer_destroy(cast->simple_frame.buffer);
|
||||||
cast->simple_frame.buffer = NULL;
|
cast->simple_frame.buffer = NULL;
|
||||||
|
|
Loading…
Reference in a new issue