signal stress tests

This commit is contained in:
Dima Granetchi committed 2014-11-13 21:32:35 +02:00
1 parent f7c2e07731
commit 1a9dc7f40d
2 files changed
+48 -1

No files matched your search

+2 -1
View File
@@ -220,7 +220,8 @@ class Signal<T> {
public function add(listener:T):Void {
var pos = listeners.indexOf(listener);
if (pos == -1) checkLock(); else listeners.splice(pos, 1);
checkLock();
if (pos > -1) listeners.splice(pos, 1);
listeners.push(listener);
}