New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ControllerInterface: Shutdown order and race condition fix. #7666

merged 1 commit into from Jan 8, 2019


3 participants
Copy link

jordan-woyak commented Jan 2, 2019

Invoke the "devices changed callbacks" after emptying the Device list and before shutting down the input backends to prevent shared_ptr<Device>s from living beyond backend shutdown.

  • This fixes a crash on shutdown when using SDL and I'm surprised the other backends put up with this.

Prevent hotplug threads from adding devices during shutdown after clearing the list. Unlikely but possible.

This fixes issue:

Copy link

BhaaLseN left a comment

Code changes seem sensible to me (once you know the intricacies of SDL's Init), untested though.

void ControllerInterface::Initialize(const WindowSystemInfo& wsi)
if (m_is_init)

m_wsi = wsi;

// Allow backends to add devices as soon as they are initialized.

This comment has been minimized.


BhaaLseN Jan 6, 2019


Note to self: SDL may end up adding devices during ciface::SDL::Init() and not during RefreshDevices()

@JosJuice JosJuice merged commit d3e1d2e into dolphin-emu:master Jan 8, 2019

9 checks passed

default Very basic checks passed, handed off to Buildbot.
lint Build succeeded on builder lint
pr-android Build succeeded on builder pr-android
pr-deb-dbg-x64 Build succeeded on builder pr-deb-dbg-x64
pr-deb-x64 Build succeeded on builder pr-deb-x64
pr-osx-x64 Build succeeded on builder pr-osx-x64
pr-ubu-x64 Build succeeded on builder pr-ubu-x64
pr-win-dbg-x64 Build succeeded on builder pr-win-dbg-x64
pr-win-x64 Build succeeded on builder pr-win-x64

@jordan-woyak jordan-woyak deleted the jordan-woyak:input-shutdown-fix branch Jan 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment