Răsfoiți Sursa

prevent duplicates in watch list

ncannasse 11 ani în urmă
părinte
comite
93239dbbb3
1 a modificat fișierele cu 6 adăugiri și 0 ștergeri
  1. 6 0
      hxd/res/LocalFileSystem.hx

+ 6 - 0
hxd/res/LocalFileSystem.hx

@@ -256,6 +256,12 @@ private class LocalEntry extends FileEntry {
 				WATCH_LIST = [];
 				flash.Lib.current.stage.addEventListener(flash.events.Event.ENTER_FRAME, checkFiles);
 			}
+			var path = path;
+			for( w in WATCH_LIST )
+				if( w.path == path ) {
+					w.watchCallback = null;
+					WATCH_LIST.remove(w);
+				}
 			WATCH_LIST.push(this);
 		}
 		watchTime = file.modificationDate.getTime();