summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-06-19 12:47:51 +0200
committerGitHub <noreply@github.com>2019-06-19 12:47:51 +0200
commit7fa941bfd8a1d81fc5c27c21635e60846efc52f4 (patch)
tree1a77e138bb336f0ce1053c38bfcfb0dd2946386e
parent2b52cd3e5c82bfb21774f8f850e2724da2baf234 (diff)
parent108de5a734e1328c54babba7f805c719537b9c30 (diff)
Merge pull request #29463 from Faless/editor/debugger_take_connection
Editor debugger now always handle connections.
-rw-r--r--editor/script_editor_debugger.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index 3b086c6316..3167abb745 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -1121,10 +1121,13 @@ void ScriptEditorDebugger::_notification(int p_what) {
last_warning_count = warning_count;
}
- if (connection.is_null()) {
-
- if (server->is_connection_available()) {
-
+ if (server->is_connection_available()) {
+ if (connection.is_valid()) {
+ // We already have a valid connection. Disconnecting any new connecting client to prevent it from hanging.
+ // (If we don't keep a reference to the connection it will be destroyed and disconnect_from_host will be called internally)
+ server->take_connection();
+ } else {
+ // We just got the first connection.
connection = server->take_connection();
if (connection.is_null())
break;
@@ -1158,12 +1161,11 @@ void ScriptEditorDebugger::_notification(int p_what) {
if (profiler->is_profiling()) {
_profiler_activate(true);
}
-
- } else {
-
- break;
}
- };
+ }
+
+ if (connection.is_null())
+ break;
if (!connection->is_connected_to_host()) {
stop();