From 347597090f0fd0002a54d7a5e3f39d5378ad8311 Mon Sep 17 00:00:00 2001 From: Nate Dudenhoeffer <1122519+AgDude@users.noreply.github.com> Date: Fri, 3 Apr 2020 12:54:51 -0500 Subject: [PATCH] Fix #248 delete javascript reference to released media (#249) Co-authored-by: Nate Dudenhoeffer --- www/Media.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/Media.js b/www/Media.js index 5806b9f6..8a3d4ae6 100644 --- a/www/Media.js +++ b/www/Media.js @@ -156,7 +156,10 @@ Media.prototype.resumeRecord = function() { * Release the resources. */ Media.prototype.release = function() { - exec(null, this.errorCallback, "Media", "release", [this.id]); + var me = this; + exec(function() { + delete mediaObjects[me.id]; + }, this.errorCallback, "Media", "release", [this.id]); }; /**