signal stress tests

This commit is contained in:
Dima Granetchi
2014-11-13 21:32:35 +02:00
parent f7c2e07731
commit 1a9dc7f40d
2 changed files with 48 additions and 1 deletions
+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);
}