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 149502 73aee2b3959fc157f02fcbbce3357e9a780a499d
parent 149501 0029abd9afdd16d7f58a889018cf7fcacdfd1c9c
child 149503 0ed8e884d35242b595a5f1b1196dea5f7eaa9918
push id2909
push userryanvm@gmail.com
push dateTue, 01 Oct 2013 21:24:54 +0000
treeherderfx-team@6290d3169a3f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmyk
bugs921103
milestone27.0a1
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