| 77 | } |
| 78 | |
| 79 | OVR_PUBLIC_FUNCTION(void) ovr_Shutdown() |
| 80 | { |
| 81 | REV_TRACE(ovr_Shutdown); |
| 82 | |
| 83 | // End all sessions |
| 84 | std::vector<XrSession> ToDestroy; |
| 85 | auto it = g_Sessions.begin(); |
| 86 | while (it != g_Sessions.end()) |
| 87 | { |
| 88 | // After years of work I have perfected my most unmaintainable line of |
| 89 | // code. It's very important that the iterator is incremented after the |
| 90 | // pointer is taken but before ovr_Destroy() is called or we *will* crash. |
| 91 | ovr_Destroy(&*it++); |
| 92 | } |
| 93 | |
| 94 | // Destroy and reset the instance |
| 95 | XrResult rs = xrDestroyInstance(g_Instance); |
| 96 | assert(XR_SUCCEEDED(rs)); |
| 97 | g_Instance = XR_NULL_HANDLE; |
| 98 | |
| 99 | MicroProfileShutdown(); |
| 100 | } |
| 101 | |
| 102 | OVR_PUBLIC_FUNCTION(void) ovr_GetLastErrorInfo(ovrErrorInfo* errorInfo) |
| 103 | { |
nothing calls this directly
no test coverage detected