Fix OpenVR shutdown crash

This commit is contained in:
Bradley Austin Davis 2016-03-17 14:37:43 -07:00
parent 1cf89f046c
commit d6d7e67ca3

View file

@ -1060,6 +1060,14 @@ void Application::showCursor(const QCursor& cursor) {
void Application::aboutToQuit() {
emit beforeAboutToQuit();
foreach(auto inputPlugin, PluginManager::getInstance()->getInputPlugins()) {
QString name = inputPlugin->getName();
QAction* action = Menu::getInstance()->getActionForOption(name);
if (action->isChecked()) {
inputPlugin->deactivate();
}
}
getActiveDisplayPlugin()->deactivate();
_aboutToQuit = true;
@ -1149,14 +1157,6 @@ Application::~Application() {
ModelEntityItem::cleanupLoadedAnimations();
foreach(auto inputPlugin, PluginManager::getInstance()->getInputPlugins()) {
QString name = inputPlugin->getName();
QAction* action = Menu::getInstance()->getActionForOption(name);
if (action->isChecked()) {
inputPlugin->deactivate();
}
}
// remove avatars from physics engine
DependencyManager::get<AvatarManager>()->clearOtherAvatars();
VectorOfMotionStates motionStates;