mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-23 18:45:36 +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,
|
QObject::connect(RemapWrapper, &SdlEventWrapper::Wrapper::SDLEvent, this,
|
||||||
&ControlSettings::processSDLEvents);
|
&ControlSettings::processSDLEvents);
|
||||||
|
|
||||||
if (!GameRunning)
|
if (!GameRunning) {
|
||||||
QFuture<void> future = QtConcurrent::run(&ControlSettings::pollSDLEvents, this);
|
Polling = QtConcurrent::run(&ControlSettings::pollSDLEvents, this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ControlSettings::SaveControllerConfig(bool CloseOnSave) {
|
void ControlSettings::SaveControllerConfig(bool CloseOnSave) {
|
||||||
@ -926,6 +927,11 @@ void ControlSettings::Cleanup() {
|
|||||||
SDL_CloseGamepad(gamepad);
|
SDL_CloseGamepad(gamepad);
|
||||||
|
|
||||||
if (!GameRunning) {
|
if (!GameRunning) {
|
||||||
|
SDL_Event quitLoop{};
|
||||||
|
quitLoop.type = SDL_EVENT_QUIT;
|
||||||
|
SDL_PushEvent(&quitLoop);
|
||||||
|
Polling.waitForFinished();
|
||||||
|
|
||||||
SDL_QuitSubSystem(SDL_INIT_GAMEPAD);
|
SDL_QuitSubSystem(SDL_INIT_GAMEPAD);
|
||||||
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
|
@ -63,6 +63,7 @@ private:
|
|||||||
QPushButton* MappingButton;
|
QPushButton* MappingButton;
|
||||||
SDL_Gamepad* gamepad = nullptr;
|
SDL_Gamepad* gamepad = nullptr;
|
||||||
SdlEventWrapper::Wrapper* RemapWrapper;
|
SdlEventWrapper::Wrapper* RemapWrapper;
|
||||||
|
QFuture<void> Polling;
|
||||||
|
|
||||||
const std::vector<std::string> ControllerInputs = {
|
const std::vector<std::string> ControllerInputs = {
|
||||||
"cross", "circle", "square", "triangle", "l1",
|
"cross", "circle", "square", "triangle", "l1",
|
||||||
|
Loading…
Reference in New Issue
Block a user