summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTechnoPorg <jonah.janzen@gmail.com>2022-06-29 19:45:37 -0600
committerTechnoPorg <jonah.janzen@gmail.com>2022-06-29 19:49:27 -0600
commit9961881b9873351a5117b77b70554cc5f1ce8617 (patch)
treead9f24d482adc112d69ec8240493de73fd33c6b2
parentce6c4ab86a8b8b2f381f91dd8f91f36e37f4f799 (diff)
Remove SceneTree dependency from LocalDebugger
Core classes should not have dependencies on scene classes.
-rw-r--r--core/debugger/local_debugger.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/debugger/local_debugger.cpp b/core/debugger/local_debugger.cpp
index 06e08081e9..58d239ccb9 100644
--- a/core/debugger/local_debugger.cpp
+++ b/core/debugger/local_debugger.cpp
@@ -31,7 +31,7 @@
#include "local_debugger.h"
#include "core/debugger/script_debugger.h"
-#include "scene/main/scene_tree.h"
+#include "core/os/os.h"
struct LocalDebugger::ScriptsProfiler {
struct ProfileInfoSort {
@@ -273,7 +273,10 @@ void LocalDebugger::debug(bool p_can_continue, bool p_is_error_breakpoint) {
script_debugger->set_depth(-1);
script_debugger->set_lines_left(-1);
- SceneTree::get_singleton()->quit();
+ MainLoop *main_loop = OS::get_singleton()->get_main_loop();
+ if (main_loop->get_class() == "SceneTree") {
+ main_loop->call("quit");
+ }
break;
} else if (line.begins_with("delete")) {
if (line.get_slice_count(" ") <= 1) {