]> khamidou — GitHub mirrors - electron.git/commitdiff
Remove explicit nullptr and add clarifying comment.
authorAndy Dill <andy.dill@gmail.com>
Thu, 21 May 2015 15:54:27 +0000 (08:54 -0700)
committerAndy Dill <andy.dill@gmail.com>
Thu, 21 May 2015 16:02:17 +0000 (09:02 -0700)
atom/common/crash_reporter/crash_reporter_win.cc

index ebb9a784da54c495327ff2f0967fa0227c0187f8..a348cf0126120c524b4375fbff6772129ec93a23 100644 (file)
@@ -54,7 +54,11 @@ void CrashReporterWin::InitBreakpad(const std::string& product_name,
   if (waiting_event != INVALID_HANDLE_VALUE)
     WaitForSingleObject(waiting_event, 1000);
 
-  breakpad_.reset(nullptr);
+  // 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(