CB-5021 Make it safe to call close() multiple times
This commit is contained in:
parent
3d8b04f982
commit
ef5eddac9a
@ -30,6 +30,7 @@ function InAppBrowser() {
|
|||||||
'loaderror' : channel.create('loaderror'),
|
'loaderror' : channel.create('loaderror'),
|
||||||
'exit' : channel.create('exit')
|
'exit' : channel.create('exit')
|
||||||
};
|
};
|
||||||
|
this._alive = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
InAppBrowser.prototype = {
|
InAppBrowser.prototype = {
|
||||||
@ -39,7 +40,10 @@ InAppBrowser.prototype = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
close: function (eventname) {
|
close: function (eventname) {
|
||||||
exec(null, null, "InAppBrowser", "close", []);
|
if (this._alive) {
|
||||||
|
this._alive = false;
|
||||||
|
exec(null, null, "InAppBrowser", "close", []);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
show: function (eventname) {
|
show: function (eventname) {
|
||||||
exec(null, null, "InAppBrowser", "show", []);
|
exec(null, null, "InAppBrowser", "show", []);
|
||||||
|
Loading…
Reference in New Issue
Block a user