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
merged 1 commit into from Jan 8, 2019

Conversation

3 participants
@jordan-woyak
Copy link
Contributor

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: https://bugs.dolphin-emu.org/issues/11399

@BhaaLseN
Copy link
Member

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)
return;

m_wsi = wsi;

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

This comment has been minimized.

@BhaaLseN

BhaaLseN Jan 6, 2019

Member

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.
Details
lint Build succeeded on builder lint
Details
pr-android Build succeeded on builder pr-android
Details
pr-deb-dbg-x64 Build succeeded on builder pr-deb-dbg-x64
Details
pr-deb-x64 Build succeeded on builder pr-deb-x64
Details
pr-osx-x64 Build succeeded on builder pr-osx-x64
Details
pr-ubu-x64 Build succeeded on builder pr-ubu-x64
Details
pr-win-dbg-x64 Build succeeded on builder pr-win-dbg-x64
Details
pr-win-x64 Build succeeded on builder pr-win-x64
Details

@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