diff --git a/src/memory_leak_debug.cpp b/src/memory_leak_debug.cpp index 86ff686..9609584 100644 --- a/src/memory_leak_debug.cpp +++ b/src/memory_leak_debug.cpp @@ -155,7 +155,8 @@ static DWORD WINAPI minidump_and_crash_thread(LPVOID param) void minidump_and_crash(size_t delay) { - CreateThread(nullptr, 0, minidump_and_crash_thread, reinterpret_cast(delay), 0, nullptr); + HANDLE h = CreateThread(nullptr, 0, minidump_and_crash_thread, reinterpret_cast(delay), 0, nullptr); + CloseHandle(h); } FORCEINLINE static void add_alocation(void* p, size_t size)