Index: lib/filterStorage.js |
=================================================================== |
--- a/lib/filterStorage.js |
+++ b/lib/filterStorage.js |
@@ -361,16 +361,17 @@ let FilterStorage = exports.FilterStorag |
* @param {nsIFile} [sourceFile] File to read from |
*/ |
loadFromDisk: function(sourceFile) |
{ |
if (this._loading) |
return; |
TimeLine.enter("Entered FilterStorage.loadFromDisk()"); |
+ this._loading = true; |
let readFile = function(sourceFile, backupIndex) |
{ |
TimeLine.enter("FilterStorage.loadFromDisk() -> readFile()"); |
let parser = new INIParser(); |
IO.readFromFile(sourceFile, true, parser, function(e) |
{ |
@@ -446,44 +447,38 @@ let FilterStorage = exports.FilterStorag |
FilterNotifier.triggerListeners("load"); |
if (sourceFile != this.sourceFile) |
this.saveToDisk(); |
TimeLine.leave("FilterStorage.loadFromDisk() read callback done"); |
}.bind(this); |
- let startRead = function(file) |
- { |
- this._loading = true; |
- readFile(file, 0); |
- }.bind(this); |
- |
let explicitFile; |
if (sourceFile) |
{ |
explicitFile = true; |
- startRead(sourceFile); |
+ readFile(sourceFile, 0); |
} |
else |
{ |
explicitFile = false; |
sourceFile = FilterStorage.sourceFile; |
let callback = function(e, statData) |
{ |
if (e || !statData.exists) |
{ |
this.firstRun = true; |
this._loading = false; |
FilterNotifier.triggerListeners("load"); |
TimeLine.leave("FilterStorage.loadFromDisk() read callback done"); |
} |
- startRead(sourceFile); |
+ readFile(sourceFile, 0); |
} |
if (sourceFile) |
IO.statFile(sourceFile, callback); |
else |
callback(true); |
} |