From a6b7573c6216f324748027f08252ba9bf706c8c5 Mon Sep 17 00:00:00 2001 From: develar Date: Sat, 27 Aug 2016 16:10:38 +0200 Subject: [PATCH] fix: close write steam on finish Closes #706 --- src/util/httpRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/httpRequest.ts b/src/util/httpRequest.ts index 3bba03de33f..1b9ef977053 100644 --- a/src/util/httpRequest.ts +++ b/src/util/httpRequest.ts @@ -85,7 +85,7 @@ function doDownload(url: string, destination: string, redirectCount: number, opt .pipe(fileOut) } - fileOut.on("finish", callback) + fileOut.on("finish", () => (fileOut.close)(callback)) }) .catch(callback)