Created attachment 176159 [details] Minimal SDL2 example code SUMMARY Every time I close my program written in C++ with SDL, KWin (the KDE window manager) leaks memory, anywhere from 1 to 10 MB at a time. After about 1 GB has leaked, KWin starts to get unstable, and it crashes soon thereafter. STEPS TO REPRODUCE 1. Run "g++ -lSDL2 sdl2.cpp" to compile the attached C++ code, which is a minimal SDL3 app 2. Run the compiled program and then close it OBSERVED RESULT KWin leaks memory, eventually to the point of a crash. EXPECTED RESULT It shouldn't leak memory. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 6.2.3 KDE Frameworks Version: 6.8.0 Qt Version: 6.8.0 Kernel Version: 6.12.1-zen1-1-zen (64-bit) Graphics Platform: X11 Processors: 20 × 13th Gen Intel® Core™ i9-13900H Memory: 31.0 GiB of RAM Graphics Processor: Mesa Intel® Graphics ADDITIONAL INFORMATION This issue happens with both SDL2 and SDL3. I often see the following error in the console after closing the program: X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 40 (X_TranslateCoords) Resource id in failed request: 0x7e171fc Serial number of failed request: 560 Current serial number in output stream: 560
Adding the x11-only keyword