Browse Source
Merge pull request #9317 from german77/input-crash
yuzu-cmd: Fix input callback crash on close
pull/15/merge
liamwhite
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
13 additions and
0 deletions
-
src/core/hid/emulated_devices.cpp
-
src/input_common/main.cpp
-
src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
|
|
|
@ -145,6 +145,7 @@ void EmulatedDevices::UnloadInput() { |
|
|
|
for (auto& button : keyboard_modifier_devices) { |
|
|
|
button.reset(); |
|
|
|
} |
|
|
|
ring_analog_device.reset(); |
|
|
|
} |
|
|
|
|
|
|
|
void EmulatedDevices::EnableConfiguration() { |
|
|
|
|
|
|
|
@ -138,6 +138,16 @@ struct InputSubsystem::Impl { |
|
|
|
Common::Input::UnregisterFactory<Common::Input::OutputDevice>(tas_input->GetEngineName()); |
|
|
|
tas_input.reset(); |
|
|
|
|
|
|
|
Common::Input::UnregisterFactory<Common::Input::InputDevice>(camera->GetEngineName()); |
|
|
|
Common::Input::UnregisterFactory<Common::Input::OutputDevice>(camera->GetEngineName()); |
|
|
|
camera.reset(); |
|
|
|
|
|
|
|
Common::Input::UnregisterFactory<Common::Input::InputDevice>( |
|
|
|
virtual_amiibo->GetEngineName()); |
|
|
|
Common::Input::UnregisterFactory<Common::Input::OutputDevice>( |
|
|
|
virtual_amiibo->GetEngineName()); |
|
|
|
virtual_amiibo.reset(); |
|
|
|
|
|
|
|
#ifdef HAVE_SDL2
|
|
|
|
Common::Input::UnregisterFactory<Common::Input::InputDevice>(sdl->GetEngineName()); |
|
|
|
Common::Input::UnregisterFactory<Common::Input::OutputDevice>(sdl->GetEngineName()); |
|
|
|
|
|
|
|
@ -7,6 +7,7 @@ |
|
|
|
#include "common/scm_rev.h"
|
|
|
|
#include "common/settings.h"
|
|
|
|
#include "core/core.h"
|
|
|
|
#include "core/hid/hid_core.h"
|
|
|
|
#include "core/perf_stats.h"
|
|
|
|
#include "input_common/drivers/keyboard.h"
|
|
|
|
#include "input_common/drivers/mouse.h"
|
|
|
|
@ -26,6 +27,7 @@ EmuWindow_SDL2::EmuWindow_SDL2(InputCommon::InputSubsystem* input_subsystem_, Co |
|
|
|
} |
|
|
|
|
|
|
|
EmuWindow_SDL2::~EmuWindow_SDL2() { |
|
|
|
system.HIDCore().UnloadInputDevices(); |
|
|
|
input_subsystem->Shutdown(); |
|
|
|
SDL_Quit(); |
|
|
|
} |
|
|
|
|