cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [01/12] git commit: CB-5021 Make it safe to call close() multiple times
Date Mon, 28 Oct 2013 22:12:59 GMT
Updated Branches:
  refs/heads/master 4d4d479b3 -> a8060219d


CB-5021 Make it safe to call close() multiple times


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/ef5eddac
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/ef5eddac
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/ef5eddac

Branch: refs/heads/master
Commit: ef5eddac9add2200e91a846cdea9e54d66b66074
Parents: 3d8b04f
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Wed Oct 9 21:25:24 2013 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Wed Oct 9 21:25:24 2013 -0400

----------------------------------------------------------------------
 www/InAppBrowser.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/ef5eddac/www/InAppBrowser.js
----------------------------------------------------------------------
diff --git a/www/InAppBrowser.js b/www/InAppBrowser.js
index 5da53fd..83f5a22 100644
--- a/www/InAppBrowser.js
+++ b/www/InAppBrowser.js
@@ -30,6 +30,7 @@ function InAppBrowser() {
         'loaderror' : channel.create('loaderror'),
         'exit' : channel.create('exit')
    };
+   this._alive = true;
 }
 
 InAppBrowser.prototype = {
@@ -39,7 +40,10 @@ InAppBrowser.prototype = {
         }
     },
     close: function (eventname) {
-        exec(null, null, "InAppBrowser", "close", []);
+        if (this._alive) {
+            this._alive = false;
+            exec(null, null, "InAppBrowser", "close", []);
+        }
     },
     show: function (eventname) {
       exec(null, null, "InAppBrowser", "show", []);


Mime
View raw message