From 14803e4cf88467a3fe5cad29bc8308e3fe574404 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 4 Aug 2015 19:18:12 +0800 Subject: [PATCH] Close handle when waiting is end --- atom/common/crash_reporter/crash_reporter_win.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/atom/common/crash_reporter/crash_reporter_win.cc b/atom/common/crash_reporter/crash_reporter_win.cc index a348cf012612..5c4f9fb4f24f 100644 --- a/atom/common/crash_reporter/crash_reporter_win.cc +++ b/atom/common/crash_reporter/crash_reporter_win.cc @@ -51,8 +51,10 @@ void CrashReporterWin::InitBreakpad(const std::string& product_name, // Wait until the crash service is started. HANDLE waiting_event = ::CreateEventW(NULL, TRUE, FALSE, L"g_atom_shell_crash_service"); - if (waiting_event != INVALID_HANDLE_VALUE) + if (waiting_event != NULL) { WaitForSingleObject(waiting_event, 1000); + CloseHandle(waiting_event); + } // ExceptionHandler() attaches our handler and ~ExceptionHandler() detaches // it, so we must explicitly reset *before* we instantiate our new handler