qarmin пре 6 година
родитељ
комит
a32f020b53
3 измењених фајлова са 8 додато и 3 уклоњено
  1. 3 1
      core/command_queue_mt.h
  2. 4 1
      core/io/file_access_network.cpp
  3. 1 1
      core/print_string.cpp

+ 3 - 1
core/command_queue_mt.h

@@ -406,8 +406,10 @@ class CommandQueueMT {
 	tryagain:
 
 		// tried to read an empty queue
-		if (read_ptr == write_ptr)
+		if (read_ptr == write_ptr) {
+			if (p_lock) unlock();
 			return false;
+		}
 
 		uint32_t size_ptr = read_ptr;
 		uint32_t size = *(uint32_t *)&command_mem[read_ptr] >> 1;

+ 4 - 1
core/io/file_access_network.cpp

@@ -118,7 +118,10 @@ void FileAccessNetworkClient::_thread_func() {
 		FileAccessNetwork *fa = NULL;
 
 		if (response != FileAccessNetwork::RESPONSE_DATA) {
-			ERR_FAIL_COND(!accesses.has(id));
+			if (!accesses.has(id)) {
+				unlock_mutex();
+				ERR_FAIL_COND(!accesses.has(id));
+			}
 		}
 
 		if (accesses.has(id))

+ 1 - 1
core/print_string.cpp

@@ -68,8 +68,8 @@ void remove_print_handler(PrintHandlerList *p_handler) {
 	}
 	//OS::get_singleton()->print("print handler list is %p\n",print_handler_list);
 
-	ERR_FAIL_COND(l == NULL);
 	_global_unlock();
+	ERR_FAIL_COND(l == NULL);
 }
 
 void print_line(String p_string) {