mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-29 01:08:44 +00:00
Wayland: Fixed file descriptor leaks if device was not initialized.
This commit is contained in:
parent
c345126266
commit
d05a39d0a6
1 changed files with 2 additions and 2 deletions
|
|
@ -347,10 +347,10 @@ Wayland_data_offer_receive(SDL_WaylandDataOffer *offer,
|
|||
|
||||
if (offer == NULL) {
|
||||
SDL_SetError("Invalid data offer");
|
||||
} else if (pipe2(pipefd, O_CLOEXEC|O_NONBLOCK) == -1) {
|
||||
SDL_SetError("Could not read pipe");
|
||||
} else if ((data_device = offer->data_device) == NULL) {
|
||||
SDL_SetError("Data device not initialized");
|
||||
} else if (pipe2(pipefd, O_CLOEXEC|O_NONBLOCK) == -1) {
|
||||
SDL_SetError("Could not read pipe");
|
||||
} else {
|
||||
wl_data_offer_receive(offer->offer, mime_type, pipefd[1]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue