History

fixed init crash if you follow very specific startup steps

Sam Gondelman committed 11 years ago

Commit 1af51571 parent 0e4d0654 files · +20 −21Browse files

Showing the changes to interface/src/Application.cpp (1 of 4 files). Show all

Unified · Split

interface/src/Application.cpp+14−15
@@ -535,21 +535,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 534 unmodified lines
535535 container->setFocus();
536536 container->installEventFilter(DependencyManager::get<OffscreenUi>().data());
537537
538− // Necessary to call this here so Oculus can get inited before Sixense
539− getDisplayPlugins();
540−
541− // must be before initializeGL()
542− _activeInputPlugins.clear();
543− auto inputPlugins = getInputPlugins();
544− foreach(auto inputPlugin, inputPlugins) {
545− QString name = inputPlugin->getName();
546− if (name == KeyboardMouseDevice::NAME) {
547− _keyboardMouseDevice = static_cast<KeyboardMouseDevice*>(inputPlugin.data()); // TODO: this seems super hacky
548− break;
549− }
550− }
551− updateInputModes();
552−
553538 _offscreenContext->makeCurrent();
554539 initializeGL();
555540 // initialization continues in initializeGL when OpenGL context is ready
@@ -894,6 +879,20 @@ void Application::initializeUi() { · 338 unmodified lines
894879 resizeGL();
895880 }
896881 });
882+
883+ // This will prevent the hid_init sixense crash
884+ getActiveDisplayPlugin();
885+
886+ // This will set up the input plugins UI
887+ _activeInputPlugins.clear();
888+ auto inputPlugins = getInputPlugins();
889+ foreach(auto inputPlugin, inputPlugins) {
890+ QString name = inputPlugin->getName();
891+ if (name == KeyboardMouseDevice::NAME) {
892+ _keyboardMouseDevice = static_cast<KeyboardMouseDevice*>(inputPlugin.data()); // TODO: this seems super hacky
893+ }
894+ }
895+ updateInputModes();
897896 }
898897
899898 template<typename F>

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t