Przeglądaj źródła

[hl] fixed crash if thread finishes w/o send/receive messages (closes #9920)

Aleksandr Kuzmenko 4 lat temu
rodzic
commit
90a3c24c7a
2 zmienionych plików z 3 dodań i 0 usunięć
  1. 1 0
      extra/CHANGES.txt
  2. 2 0
      std/hl/_std/sys/thread/Thread.hx

+ 1 - 0
extra/CHANGES.txt

@@ -3,6 +3,7 @@
 	Bugfixes:
 
 	jvm : fixed equality checks for `Null<Float>` and `Null<Int>` (#9897)
+	hl : fixed crash if a thread finishes without invoking `sendMessage`/`readMessage` (#9920)
 
 2020-09-11 4.1.4:
 

+ 2 - 0
std/hl/_std/sys/thread/Thread.hx

@@ -69,6 +69,8 @@ abstract Thread(ThreadHandle) from ThreadHandle to ThreadHandle {
 	}
 
 	static inline function dropThread(handle:ThreadHandle) {
+		if( queue_mutex == null )
+			return;
 		queue_mutex.acquire();
 		for (i => tq in threads_queues) {
 			if (tq.t == handle) {