Skip to content

Commit 1f100a2

Browse files
committed
svn_sync
1 parent 003185f commit 1f100a2

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

script/ide/FileSystemWatcher.lua

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,12 @@ end
9494

9595
-- remove this file watcher.
9696
function FileSystemWatcher:Destroy()
97+
self:RemoveAllDirectories();
9798
unregisterCallback(self.name, self);
98-
watcher_dirs[self.name] = nil;
99+
100+
if( not call_backs[self.name]) then
101+
watcher_dirs[self.name] = nil;
102+
end
99103
end
100104

101105

@@ -237,6 +241,18 @@ function FileSystemWatcher:RemoveDirectory(dir)
237241
end
238242
end
239243

244+
-- unwatch all directories
245+
function FileSystemWatcher:RemoveAllDirectories()
246+
while(true) do
247+
local dir = next(self.dirs, nil);
248+
if(dir) then
249+
self:RemoveDirectory(dir);
250+
else
251+
break;
252+
end
253+
end
254+
end
255+
240256
-- because it is so common to watch for asset file changes, we added the following function
241257
-- call this at any time to start watching for files
242258
function FileSystemWatcher.EnableAssetFileWatcher()

0 commit comments

Comments
 (0)