Skip to content

Commit 84e90de

Browse files
addaleaxjoyeecheung
authored andcommitted
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 391f839 commit 84e90de

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/node.cc

Lines changed: 1 addition & 2 deletions
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
}
@@ -1477,7 +1477,6 @@ int Start(int argc, char** argv) {
14771477
per_process::v8_initialized = true;
14781478
const int exit_code =
14791479
Start(uv_default_loop(), args, exec_args);
1480-
v8_platform.StopTracingAgent();
14811480
per_process::v8_initialized = false;
14821481
V8::Dispose();
14831482

0 commit comments

Comments
 (0)