| 221 | } |
| 222 | |
| 223 | OVR_PUBLIC_FUNCTION(void) ovr_Destroy(ovrSession session) |
| 224 | { |
| 225 | REV_TRACE(ovr_Destroy); |
| 226 | |
| 227 | session->DestroySession(); |
| 228 | |
| 229 | if (!session->HookedFunctions.empty()) |
| 230 | { |
| 231 | DetourTransactionBegin(); |
| 232 | DetourUpdateThread(GetCurrentThread()); |
| 233 | for (auto it : session->HookedFunctions) |
| 234 | DetourDetach(it.first, it.second); |
| 235 | DetourTransactionCommit(); |
| 236 | } |
| 237 | |
| 238 | // Delete the session from the list of sessions |
| 239 | g_Sessions.erase(std::find_if(g_Sessions.begin(), g_Sessions.end(), [session](ovrHmdStruct const& o) { return &o == session; })); |
| 240 | } |
| 241 | |
| 242 | OVR_PUBLIC_FUNCTION(ovrResult) ovr_GetSessionStatus(ovrSession session, ovrSessionStatus* sessionStatus) |
| 243 | { |
no test coverage detected