mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
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: https://github.com/nodejs/node/pull/25472 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
1 parent
391f839563
commit
84e90decd5
1 file changed
+1
-2
+1
-2
@@ -240,6 +240,7 @@ static struct {
|
||||
}
|
||||
|
||||
void Dispose() {
|
||||
StopTracingAgent();
|
||||
platform_->Shutdown();
|
||||
delete platform_;
|
||||
platform_ = nullptr;
|
||||
@@ -579,7 +580,6 @@ static void WaitForInspectorDisconnect(Environment* env) {
|
||||
void Exit(const FunctionCallbackInfo<Value>& args) {
|
||||
Environment* env = Environment::GetCurrent(args);
|
||||
WaitForInspectorDisconnect(env);
|
||||
v8_platform.StopTracingAgent();
|
||||
int code = args[0]->Int32Value(env->context()).FromMaybe(0);
|
||||
env->Exit(code);
|
||||
}
|
||||
@@ -1477,7 +1477,6 @@ int Start(int argc, char** argv) {
|
||||
per_process::v8_initialized = true;
|
||||
const int exit_code =
|
||||
Start(uv_default_loop(), args, exec_args);
|
||||
v8_platform.StopTracingAgent();
|
||||
per_process::v8_initialized = false;
|
||||
V8::Dispose();
|
||||
|
||||
|
||||
Reference in new issue
Block a user