Skip to content

Commit

Permalink
svn_sync
Browse files Browse the repository at this point in the history
  • Loading branch information
LiXizhi committed Nov 21, 2017
1 parent 003185f commit 1f100a2
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion script/ide/FileSystemWatcher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ end

-- remove this file watcher.
function FileSystemWatcher:Destroy()
self:RemoveAllDirectories();
unregisterCallback(self.name, self);
watcher_dirs[self.name] = nil;

if( not call_backs[self.name]) then
watcher_dirs[self.name] = nil;
end
end


Expand Down Expand Up @@ -237,6 +241,18 @@ function FileSystemWatcher:RemoveDirectory(dir)
end
end

-- unwatch all directories
function FileSystemWatcher:RemoveAllDirectories()
while(true) do
local dir = next(self.dirs, nil);
if(dir) then
self:RemoveDirectory(dir);
else
break;
end
end
end

-- because it is so common to watch for asset file changes, we added the following function
-- call this at any time to start watching for files
function FileSystemWatcher.EnableAssetFileWatcher()
Expand Down

0 comments on commit 1f100a2

Please sign in to comment.