mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-25 15:35:58 +01:00
Revert "Remove unnecessary check from wlr_screencast.c" (#54)
* Revert "Remove unnecessary check from wlr_screencast.c"
This reverts commit cc59abb124
.
Fixes emersion/xdg-desktop-portal-wlr#50
* Clarify why the check in wlr_screencast is needed
This commit is contained in:
parent
61db8968f9
commit
25e7719d18
1 changed files with 8 additions and 3 deletions
|
@ -20,9 +20,14 @@
|
|||
#include "logger.h"
|
||||
|
||||
static void wlr_frame_buffer_destroy(struct xdpw_screencast_instance *cast) {
|
||||
// Even though this check may be deemed unnecessary,
|
||||
// this has been found to cause SEGFAULTs, like this one:
|
||||
// https://github.com/emersion/xdg-desktop-portal-wlr/issues/50
|
||||
if (cast->simple_frame.data != NULL) {
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue