You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I have the same issue.
Tested on Windows 10 Pro x64 build 19043 with Xbox 360 Controller (and other controllers too).
I tested with SDL version 2.0.16, 2.0.14 and also the zip version you posted
It only goes up when I press buttons/move axis around on my controller. If no controller inputs, User objects does not increase.
If I do SDL_PollEvent the problem goes away, or as mentioned above SDL_SetHint(SDL_HINT_JOYSTICK_THREAD, "1"); also makes the problem go away.
#include"SDL.h"
#include<iostream>
#include<chrono>
#include<thread>namespace {
voidPollEvents() {
SDL_Event oEvent;
while (SDL_PollEvent(&oEvent)) {
}
}
}
#undef main
intmain(int argc, char* argv[]) {
// SDL_SetHint(SDL_HINT_JOYSTICK_THREAD, "1"); // uncomment this and no more leaksif (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
returnfalse;
}
while (true) {
// PollEvents(); // OR uncomment this and no more leaksstd::this_thread::sleep_for(std::chrono::milliseconds(100));
}
SDL_Quit();
}
With a Dualshock 4 connected and HID support disabled SDL2 leaks User Objects like there's no tomorrow.
Tested on Windows 10 pro x64 build 19042.870
I've noticed the issue doesn't occur when SDL_SetHint(SDL_HINT_JOYSTICK_THREAD, "1"); is set
Issue easily reproducible with latest official DLL '2.0.14' and the following test code (with a Dualshock 4 connected via USB)
The text was updated successfully, but these errors were encountered: