[xboxdrv] 10/78: Moved USBSubsystem init up a level, as otherwise it would get destructed while code was still accessing it
Andrey Rahmatullin
wrar-guest at moszumanska.debian.org
Sun Feb 21 17:55:07 UTC 2016
This is an automated email from the git hooks/post-receive script.
wrar-guest pushed a commit to branch master
in repository xboxdrv.
commit 8566800c0993b39e46d4982144a08c484e0f0ed9
Author: Ingo Ruhnke <grumbel at gmail.com>
Date: Sun Jun 1 23:04:29 2014 +0200
Moved USBSubsystem init up a level, as otherwise it would get destructed while code was still accessing it
---
src/xboxdrv.cpp | 9 ++++++---
src/xboxdrv_daemon.cpp | 2 --
src/xboxdrv_main.cpp | 2 --
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/xboxdrv.cpp b/src/xboxdrv.cpp
index 535cc99..709541f 100644
--- a/src/xboxdrv.cpp
+++ b/src/xboxdrv.cpp
@@ -29,18 +29,19 @@
#include <sys/types.h>
#include <unistd.h>
-#include "controller_thread.hpp"
#include "command_line_options.hpp"
+#include "controller_factory.hpp"
+#include "controller_thread.hpp"
#include "dummy_message_processor.hpp"
#include "evdev_controller.hpp"
#include "evdev_helper.hpp"
#include "helper.hpp"
#include "raise_exception.hpp"
#include "uinput_message_processor.hpp"
-#include "usb_helper.hpp"
#include "usb_gsource.hpp"
+#include "usb_helper.hpp"
+#include "usb_subsystem.hpp"
#include "word_wrap.hpp"
-#include "controller_factory.hpp"
#include "xboxdrv_daemon.hpp"
#include "xboxdrv_main.hpp"
@@ -196,6 +197,7 @@ Xboxdrv::run_main(const Options& opts)
print_copyright();
}
+ USBSubsystem usb_subsystem;
XboxdrvMain xboxdrv_main(opts);
xboxdrv_main.run();
}
@@ -246,6 +248,7 @@ Xboxdrv::run_daemon(const Options& opts)
}
else
{
+ USBSubsystem usb_subsystem;
XboxdrvDaemon daemon(opts);
daemon.run();
}
diff --git a/src/xboxdrv_daemon.cpp b/src/xboxdrv_daemon.cpp
index 46a2e3e..c2053fd 100644
--- a/src/xboxdrv_daemon.cpp
+++ b/src/xboxdrv_daemon.cpp
@@ -137,8 +137,6 @@ XboxdrvDaemon::run()
init_uinput();
- USBSubsystem usb_subsystem;
-
UdevSubsystem udev_subsystem;
udev_subsystem.set_device_callback(boost::bind(&XboxdrvDaemon::process_match, this, _1));
diff --git a/src/xboxdrv_main.cpp b/src/xboxdrv_main.cpp
index 3c0c487..a5a655c 100644
--- a/src/xboxdrv_main.cpp
+++ b/src/xboxdrv_main.cpp
@@ -143,8 +143,6 @@ XboxdrvMain::on_controller_disconnect()
void
XboxdrvMain::run()
{
- USBSubsystem usb_subsystem;
-
m_controller = create_controller();
m_controller->set_disconnect_cb(boost::bind(&XboxdrvMain::on_controller_disconnect, this));
std::auto_ptr<MessageProcessor> message_proc;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/xboxdrv.git
More information about the Pkg-games-commits
mailing list