MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / Dispose

Method Dispose

PerformanceMonitor/DebugMonitor.cs:290–329  ·  view source on GitHub ↗

Dispose all resources

()

Source from the content-addressed store, hash-verified

288 /// Dispose all resources
289 /// </summary>
290 private static void Dispose() {
291 // Close AckEvent
292 if (m_AckEvent != IntPtr.Zero) {
293 if (!CloseHandle(m_AckEvent)) {
294 throw CreateApplicationException("Failed to close handle for 'AckEvent'");
295 }
296 m_AckEvent = IntPtr.Zero;
297 }
298
299 // Close ReadyEvent
300 if (m_ReadyEvent != IntPtr.Zero) {
301 if (!CloseHandle(m_ReadyEvent)) {
302 throw CreateApplicationException("Failed to close handle for 'ReadyEvent'");
303 }
304 m_ReadyEvent = IntPtr.Zero;
305 }
306
307 // Close SharedFile
308 if (m_SharedFile != IntPtr.Zero) {
309 if (!CloseHandle(m_SharedFile)) {
310 throw CreateApplicationException("Failed to close handle for 'SharedFile'");
311 }
312 m_SharedFile = IntPtr.Zero;
313 }
314
315
316 // Unmap SharedMem
317 if (m_SharedMem != IntPtr.Zero) {
318 if (!UnmapViewOfFile(m_SharedMem)) {
319 throw CreateApplicationException("Failed to unmap view for slot 'DBWIN_BUFFER'");
320 }
321 m_SharedMem = IntPtr.Zero;
322 }
323
324 // Close our mutex
325 if (m_Mutex != null) {
326 m_Mutex.Close();
327 m_Mutex = null;
328 }
329 }
330
331 /// <summary>
332 /// Stops this debug monitor. This call we block the executing thread

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected