Skip to content

Commit 7ffa8ec

Browse files
committed
src: reset StopTracingAgent() before platform teardown
This makes sure that `StopTracingAgent()` is always called before tearing down the `tracing::Agent`, since previously its destructor might have tried to access the agent, which would be destroyed by the (earlier) `Dispose()` call. PR-URL: #25472 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent 6347940 commit 7ffa8ec

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/node.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ static struct {
240240
}
241241

242242
void Dispose() {
243+
StopTracingAgent();
243244
platform_->Shutdown();
244245
delete platform_;
245246
platform_ = nullptr;
@@ -579,7 +580,6 @@ static void WaitForInspectorDisconnect(Environment* env) {
579580
void Exit(const FunctionCallbackInfo<Value>& args) {
580581
Environment* env = Environment::GetCurrent(args);
581582
WaitForInspectorDisconnect(env);
582-
v8_platform.StopTracingAgent();
583583
int code = args[0]->Int32Value(env->context()).FromMaybe(0);
584584
env->Exit(code);
585585
}
@@ -1468,7 +1468,6 @@ int Start(int argc, char** argv) {
14681468
per_process::v8_initialized = true;
14691469
const int exit_code =
14701470
Start(uv_default_loop(), args, exec_args);
1471-
v8_platform.StopTracingAgent();
14721471
per_process::v8_initialized = false;
14731472
V8::Dispose();
14741473

0 commit comments

Comments
 (0)