Merge pull request #1706 from hammerandchisel/crash-reporter-reinit

Explicitly null the crash reporter before assigning it
This commit is contained in:
Cheng Zhao 2015-05-22 10:17:00 +08:00
commit c372dcb462

View file

@ -54,6 +54,11 @@ void CrashReporterWin::InitBreakpad(const std::string& product_name,
if (waiting_event != INVALID_HANDLE_VALUE)
WaitForSingleObject(waiting_event, 1000);
// ExceptionHandler() attaches our handler and ~ExceptionHandler() detaches
// it, so we must explicitly reset *before* we instantiate our new handler
// to allow any previous handler to detach in the correct order.
breakpad_.reset();
int handler_types = google_breakpad::ExceptionHandler::HANDLER_EXCEPTION |
google_breakpad::ExceptionHandler::HANDLER_PURECALL;
breakpad_.reset(new google_breakpad::ExceptionHandler(