You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ti...@apache.org on 2020/04/03 17:55:02 UTC

[cordova-plugin-media] branch master updated: Fix #248 delete javascript reference to released media (#249)

This is an automated email from the ASF dual-hosted git repository.

timbru31 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-media.git


The following commit(s) were added to refs/heads/master by this push:
     new 3475970  Fix #248 delete javascript reference to released media (#249)
3475970 is described below

commit 347597090f0fd0002a54d7a5e3f39d5378ad8311
Author: Nate Dudenhoeffer <11...@users.noreply.github.com>
AuthorDate: Fri Apr 3 12:54:51 2020 -0500

    Fix #248 delete javascript reference to released media (#249)
    
    Co-authored-by: Nate Dudenhoeffer <ag...@users.noreply.github.com>
---
 www/Media.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/www/Media.js b/www/Media.js
index 5806b9f..8a3d4ae 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]);
 };
 
 /**


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org