]> khamidou — GitHub mirrors - electron.git/commitdiff
Close handle when waiting is end
authorCheng Zhao <zcbenz@gmail.com>
Tue, 4 Aug 2015 11:18:12 +0000 (19:18 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 4 Aug 2015 11:18:12 +0000 (19:18 +0800)
atom/common/crash_reporter/crash_reporter_win.cc

index a348cf0126120c524b4375fbff6772129ec93a23..5c4f9fb4f24f4ac069287598103a8a690b989d38 100644 (file)
@@ -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