瀏覽代碼

prevent duplicates in watch list

ncannasse 11 年之前
父節點
當前提交
93239dbbb3
共有 1 個文件被更改,包括 6 次插入0 次删除
  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();