From 565796518d27e345c4d53a13048f306a8f2c57a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Sat, 6 Mar 2021 13:26:16 +0100 Subject: Fix crash on cleanup of EditorFileServer --- editor/fileserver/editor_file_server.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'editor/fileserver/editor_file_server.cpp') diff --git a/editor/fileserver/editor_file_server.cpp b/editor/fileserver/editor_file_server.cpp index 07edae833d..d80003a12a 100644 --- a/editor/fileserver/editor_file_server.cpp +++ b/editor/fileserver/editor_file_server.cpp @@ -43,7 +43,7 @@ void EditorFileServer::_close_client(ClientData *cd) { cd->connection->disconnect_from_host(); { MutexLock lock(cd->efs->wait_mutex); - cd->efs->to_wait.insert(&cd->thread); + cd->efs->to_wait.insert(cd->thread); } while (cd->files.size()) { memdelete(cd->files.front()->get()); @@ -278,7 +278,8 @@ void EditorFileServer::_thread_start(void *s) { cd->connection = self->server->take_connection(); cd->efs = self; cd->quit = false; - cd->thread.start(_subthread_start, cd); + cd->thread = memnew(Thread); + cd->thread->start(_subthread_start, cd); } } -- cgit v1.2.3