summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
diff options
context:
space:
mode:
authorAnthony <Helios747@users.noreply.github.com>2016-11-30 20:47:38 -0600
committerGitHub <noreply@github.com>2016-11-30 20:47:38 -0600
commita95e3c875e2749b4a489aa988f5b35608f5a8b59 (patch)
tree5239317db159c4fc5ab7272e3ac866d1487fca54 /Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
parente2018f22085dd168b8ef6ec1c8ff6260e8c3e8b2 (diff)
parent3e69d066f5e9ad0a1097d806c656035398bbb7bc (diff)
Merge pull request #4343 from ligfx/fixsdlcrash
ControllerInterface: Fix crashes when using SDL controllers
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
index d3f8f5fd36..bee0c44a02 100644
--- a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
@@ -141,10 +141,15 @@ static void StopHotplugThread()
void Init()
{
s_devnode_name_map.clear();
+ PopulateDevices();
+ StartHotplugThread();
+}
- // During initialization we use udev to iterate over all /dev/input/event* devices.
- // Note: the Linux kernel is currently limited to just 32 event devices. If this ever
- // changes, hopefully udev will take care of this.
+void PopulateDevices()
+{
+ // We use udev to iterate over all /dev/input/event* devices.
+ // Note: the Linux kernel is currently limited to just 32 event devices. If
+ // this ever changes, hopefully udev will take care of this.
udev* udev = udev_new();
_assert_msg_(PAD, udev != nullptr, "Couldn't initialize libudev.");
@@ -182,8 +187,6 @@ void Init()
}
udev_enumerate_unref(enumerate);
udev_unref(udev);
-
- StartHotplugThread();
}
void Shutdown()