diff --git a/shell/browser/api/electron_api_net_log.cc b/shell/browser/api/electron_api_net_log.cc index 45c21384c15..5447ac35634 100644 --- a/shell/browser/api/electron_api_net_log.cc +++ b/shell/browser/api/electron_api_net_log.cc @@ -166,6 +166,7 @@ void NetLog::StartNetLogAfterCreateFile(net::NetLogCaptureMode capture_mode, std::move(*pending_start_promise_) .RejectWithErrorMessage( base::File::ErrorToString(output_file.error_details())); + pending_start_promise_.reset(); net_log_exporter_.reset(); return; } @@ -178,6 +179,7 @@ void NetLog::StartNetLogAfterCreateFile(net::NetLogCaptureMode capture_mode, void NetLog::NetLogStarted(int32_t error) { DCHECK(pending_start_promise_); ResolvePromiseWithNetError(std::move(*pending_start_promise_), error); + pending_start_promise_.reset(); } void NetLog::OnConnectionError() { @@ -185,6 +187,7 @@ void NetLog::OnConnectionError() { if (pending_start_promise_) { std::move(*pending_start_promise_) .RejectWithErrorMessage("Failed to start net log exporter"); + pending_start_promise_.reset(); } }