Commit: 185619229ca9e5f1a982366c4eaa3eef3c0081a9
Author: Joey Ferwerda
Date:   Wed Jun 8 16:57:18 2016 +0200
Branches: HMD_viewport
https://developer.blender.org/rB185619229ca9e5f1a982366c4eaa3eef3c0081a9

Fixed locks when opening/closing HMD sessions
Spaces to Tabs

===================================================================

M       intern/ghost/intern/GHOST_OpenHMDManager.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_OpenHMDManager.cpp 
b/intern/ghost/intern/GHOST_OpenHMDManager.cpp
index a3232e2..fd103a0 100644
--- a/intern/ghost/intern/GHOST_OpenHMDManager.cpp
+++ b/intern/ghost/intern/GHOST_OpenHMDManager.cpp
@@ -168,16 +168,16 @@ bool GHOST_OpenHMDManager::openDevice(int index)
 
        ohmd_device_settings* settings = ohmd_device_settings_create(m_context);
 
-    // If OHMD_IDS_AUTOMATIC_UPDATE is set to 0, ohmd_ctx_update() must be 
called at least 10 times per second.
-    // It is enabled by default, runs in seperate thread.
-    // This allows for correct tracking on low framerates, needed for heavy 
scenes.
+       // If OHMD_IDS_AUTOMATIC_UPDATE is set to 0, ohmd_ctx_update() must be 
called at least 10 times per second.
+       // It is enabled by default, runs in seperate thread.
+       // This allows for correct tracking on low framerates, needed for heavy 
scenes.
 
-    int auto_update = 1;
-    ohmd_device_settings_seti(settings, OHMD_IDS_AUTOMATIC_UPDATE, 
&auto_update);
+       int auto_update = 1;
+       ohmd_device_settings_seti(settings, OHMD_IDS_AUTOMATIC_UPDATE, 
&auto_update);
+
+       m_device = ohmd_list_open_device_s(m_context, index, settings);
+       ohmd_device_settings_destroy(settings); //cleanup settings
 
-    m_device = ohmd_list_open_device_s(m_context, index, settings);
-    ohmd_device_settings_destroy(settings); //cleanup settings
-       
        return true;
 }
 
@@ -187,6 +187,8 @@ void GHOST_OpenHMDManager::closeDevice()
                return;
        }
 
+       ohmd_close_device(m_device);
+
        m_device = NULL;
        m_deviceIndex = -1;
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to