From 4277dab985d10123e984fed028100acd78306e5e Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Mon, 21 Jul 2014 15:51:53 +0200 Subject: [PATCH] Cleanup temporary files on "stop". --- static/js/services/filedata.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/static/js/services/filedata.js b/static/js/services/filedata.js index daf3e24e..fb591df7 100644 --- a/static/js/services/filedata.js +++ b/static/js/services/filedata.js @@ -373,7 +373,13 @@ define(["jquery", "underscore", "sha", "webrtc.adapter"], function($, _, jsSHA) File.prototype.stop = function() { this.e.triggerHandler("stop", [this]); - this.file = null; + if (this.file && this.file.remove) { + var file = this.file; + this.file.remove(_.bind(function() { + console.log("File removed", file); + }, this)); + this.file = null; + } if (this.writer) { this.writer.stop(); this.writer = null;