summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2020-01-13 21:46:41 +0100
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2020-01-13 21:46:44 +0100
commitd5122ab31cea2364d7914a796572d457eac025ed (patch)
tree6c423712b7a62cbfdfc25b19b81ba5dae9226e09
parent1cf387ed9dcce39afb9c06b3a50b725d8b6f0461 (diff)
Sync pending VisualServer commands after ScriptServer finalization
This is needed as C# may free resources from the finalizer thread during CSharpLanguage::finish(). Previously this would result in RIDs not being freed.
-rw-r--r--main/main.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp
index 2f92451844..0ff392978a 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -2169,6 +2169,9 @@ void Main::cleanup() {
ScriptServer::finish_languages();
+ // Sync pending commands that may have been queued from a different thread during ScriptServer finalization
+ VisualServer::get_singleton()->sync();
+
#ifdef TOOLS_ENABLED
EditorNode::unregister_editor_types();
#endif