fix VFS cache race condition causing VFS conneciton to never be cleaned up.

pull/223/head
Fabian Jakobs 2015-11-02 11:41:06 +00:00 zatwierdzone przez Fabian Jakobs
rodzic 9b9a9f52b1
commit 4a72d312d8
1 zmienionych plików z 1 dodań i 3 usunięć

Wyświetl plik

@ -5,7 +5,6 @@ define(function(require, exports, module) {
main.provides = ["vfs.cache"]; main.provides = ["vfs.cache"];
return main; return main;
function main(options, imports, register) { function main(options, imports, register) {
var Plugin = imports.Plugin; var Plugin = imports.Plugin;
var connectVfs = imports["vfs.connect"].connect; var connectVfs = imports["vfs.connect"].connect;
@ -58,6 +57,7 @@ define(function(require, exports, module) {
entry.emit("loaded"); entry.emit("loaded");
cache[vfsid] = entry; cache[vfsid] = entry;
entry.keepalive();
vfs.on("destroy", function() { vfs.on("destroy", function() {
remove(vfsid); remove(vfsid);
@ -126,7 +126,6 @@ define(function(require, exports, module) {
}; };
entry.keepalive = function() { entry.keepalive = function() {
clearTimeout(timer);
startTimer(); startTimer();
}; };
@ -139,7 +138,6 @@ define(function(require, exports, module) {
}, maxAge); }, maxAge);
} }
startTimer();
return entry; return entry;
} }