Skip to content

Commit 574f6ef

Browse files
committed
Properly close directory watchers and check for stop method
1 parent 77077cd commit 574f6ef

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

plugins-server/cloud9.ide.watcher/watcher.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,16 @@ util.inherits(WatcherPlugin, Plugin);
199199
var watchers = this.clients[clientId].fileWatchers;
200200
if (watchers[path]) {
201201
if (watchers[path].watcher)
202-
watchers[path].watcher.close();
202+
watchers[path].watcher.close ? watchers[path].watcher.close() : watchers[path].watcher.stop();
203203
delete watchers[path];
204204
}
205205
};
206206

207207
this.removeDirectoryWatcher = function(clientId, path) {
208208
var watchers = this.clients[clientId].directoryWatchers;
209209
if (watchers[path]) {
210-
if (watchers.watcher)
211-
watchers.watcher.close();
210+
if (watchers[path].watcher)
211+
watchers[path].watcher.close ? watchers[path].watcher.close() : watchers[path].watcher.stop();
212212
delete watchers[path];
213213
}
214214
};

0 commit comments

Comments
 (0)