Bug 921103 - Close the webapp.json file once it's been read. r=myk
authorMarco Castelluccio <mar.castelluccio@studenti.unina.it>
Tue, 01 Oct 2013 08:06:57 -0400
changeset 164261 73aee2b3959fc157f02fcbbce3357e9a780a499d
parent 164260 0029abd9afdd16d7f58a889018cf7fcacdfd1c9c
child 164262 0ed8e884d35242b595a5f1b1196dea5f7eaa9918
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmyk
bugs921103
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 921103 - Close the webapp.json file once it's been read. r=myk
webapprt/WebappRT.jsm
--- a/webapprt/WebappRT.jsm
+++ b/webapprt/WebappRT.jsm
@@ -23,17 +23,17 @@ this.WebappRT = {
   get config() {
     if (this._config)
       return this._config;
 
     let webappFile = FileUtils.getFile("AppRegD", ["webapp.json"]);
 
     let inputStream = Cc["@mozilla.org/network/file-input-stream;1"].
                       createInstance(Ci.nsIFileInputStream);
-    inputStream.init(webappFile, -1, 0, 0);
+    inputStream.init(webappFile, -1, 0, Ci.nsIFileInputStream.CLOSE_ON_EOF);
     let json = Cc["@mozilla.org/dom/json;1"].createInstance(Ci.nsIJSON);
     let config = json.decodeFromStream(inputStream, webappFile.fileSize);
 
     return this._config = config;
   },
 
   // This exists to support test mode, which installs webapps after startup.
   // Ideally we wouldn't have to have a setter, as tests can just delete