Close handle when waiting is end

This commit is contained in:
Cheng Zhao 2015-08-04 19:18:12 +08:00
parent 1347c61c8e
commit 14803e4cf8

View 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