From 06972ab8b55444f3b1c360f426167d24ccfd6f94 Mon Sep 17 00:00:00 2001 From: yang-19970325 Date: Mon, 27 Nov 2023 19:51:17 +0800 Subject: [PATCH] Fix invalid files in release application when loadmoduleevent Issue:#I8JVMW Signed-off-by: yang-19970325 Change-Id: I196d8c766ef0dec9b72bd64dc20f4de80c33be8d --- tooling/dispatcher.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tooling/dispatcher.cpp b/tooling/dispatcher.cpp index cd701ba..4b17a17 100644 --- a/tooling/dispatcher.cpp +++ b/tooling/dispatcher.cpp @@ -151,13 +151,15 @@ Dispatcher::Dispatcher(const EcmaVM *vm, ProtocolChannel *channel) dispatchers_["Tracing"] = std::make_unique(channel, std::move(tracing)); - // debugger - auto runtime = std::make_unique(vm, channel); - auto debugger = std::make_unique(vm, channel, runtime.get()); - dispatchers_["Runtime"] = - std::make_unique(channel, std::move(runtime)); - dispatchers_["Debugger"] = - std::make_unique(channel, std::move(debugger)); + // only debugApp need to initialize debugger + if (vm->GetJsDebuggerManager()->IsDebugApp()) { + auto runtime = std::make_unique(vm, channel); + auto debugger = std::make_unique(vm, channel, runtime.get()); + dispatchers_["Runtime"] = + std::make_unique(channel, std::move(runtime)); + dispatchers_["Debugger"] = + std::make_unique(channel, std::move(debugger)); + } auto dom = std::make_unique(); dispatchers_["DOM"] =