mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-22 18:15:14 +00:00
Properly exit event loop thread on exit
This commit is contained in:
parent
f1b6342313
commit
06407be5a7
@ -124,8 +124,9 @@ ControlSettings::ControlSettings(std::shared_ptr<GameInfoClass> game_info_get, b
|
||||
QObject::connect(RemapWrapper, &SdlEventWrapper::Wrapper::SDLEvent, this,
|
||||
&ControlSettings::processSDLEvents);
|
||||
|
||||
if (!GameRunning)
|
||||
QFuture<void> future = QtConcurrent::run(&ControlSettings::pollSDLEvents, this);
|
||||
if (!GameRunning) {
|
||||
Polling = QtConcurrent::run(&ControlSettings::pollSDLEvents, this);
|
||||
}
|
||||
}
|
||||
|
||||
void ControlSettings::SaveControllerConfig(bool CloseOnSave) {
|
||||
@ -926,6 +927,11 @@ void ControlSettings::Cleanup() {
|
||||
SDL_CloseGamepad(gamepad);
|
||||
|
||||
if (!GameRunning) {
|
||||
SDL_Event quitLoop{};
|
||||
quitLoop.type = SDL_EVENT_QUIT;
|
||||
SDL_PushEvent(&quitLoop);
|
||||
Polling.waitForFinished();
|
||||
|
||||
SDL_QuitSubSystem(SDL_INIT_GAMEPAD);
|
||||
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
||||
SDL_Quit();
|
||||
|
@ -63,6 +63,7 @@ private:
|
||||
QPushButton* MappingButton;
|
||||
SDL_Gamepad* gamepad = nullptr;
|
||||
SdlEventWrapper::Wrapper* RemapWrapper;
|
||||
QFuture<void> Polling;
|
||||
|
||||
const std::vector<std::string> ControllerInputs = {
|
||||
"cross", "circle", "square", "triangle", "l1",
|
||||
|
Loading…
Reference in New Issue
Block a user