SDL icon indicating copy to clipboard operation
SDL copied to clipboard

zenity dialog: fix data race and reduce number of allocs

Open marcin-serwin opened this issue 2 months ago • 14 comments

Description

dialog/unix: remove /usr/bin/env indirection

SDL process is using posix_spawnp which already does the path lookup so additional indirection via env is unnecessary

dialog/unix: reduce string allocations

Simplifies logic of spawning the zenity process by avoiding allocations of static strings

dialog/unix: stricter typing

Introduce const where appropriate

dialog/unix: deep copy args to avoid data race

SDL properties passed to the SDL_Zenity_ShowFileDialogWithProperties may be destroyed/modified immediately upon the function return. Therefore, we must copy all the strings and structures passed via pointers; otherwise, the SDL_ZenityFileDialog thread attempting to read them will cause data race.

Existing Issue(s)

N/A

marcin-serwin avatar Dec 07 '24 19:12 marcin-serwin