Fixes LSP connection error when launched in a separate thread

(cherry picked from commit a5710d468b)
This commit is contained in:
azuloo 2023-08-16 16:29:28 +03:00 committed by Yuri Sizov
parent eaa2485a5d
commit 3de5e5d4d4
1 changed files with 1 additions and 0 deletions

View File

@ -73,6 +73,7 @@ void GDScriptLanguageServer::_notification(int p_what) {
} }
void GDScriptLanguageServer::thread_main(void *p_userdata) { void GDScriptLanguageServer::thread_main(void *p_userdata) {
set_current_thread_safe_for_nodes(true);
GDScriptLanguageServer *self = static_cast<GDScriptLanguageServer *>(p_userdata); GDScriptLanguageServer *self = static_cast<GDScriptLanguageServer *>(p_userdata);
while (self->thread_running) { while (self->thread_running) {
// Poll 20 times per second // Poll 20 times per second