From 8894da4f933459b6afc2fab2f2669fe7ea0452de Mon Sep 17 00:00:00 2001 From: SChernykh <15806605+SChernykh@users.noreply.github.com> Date: Sun, 21 Jul 2024 11:58:21 +0200 Subject: [PATCH] Fixed handle leak --- src/memory_leak_debug.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)