fix iOS crash when call Destory

This commit is contained in:
pengfei.zhou
2020-05-06 17:34:48 +08:00
committed by osborn
parent c9c99cce06
commit 7828b24cd5
12 changed files with 43 additions and 2 deletions

View File

@@ -946,6 +946,7 @@ function NativeCall(target, propertyKey, descriptor) {
}
var Panel = /** @class */ (function () {
function Panel() {
this.destroyed = false;
this.__root__ = new Root;
this.headviews = new Map;
this.onRenderFinishedCallback = [];
@@ -1002,6 +1003,7 @@ var Panel = /** @class */ (function () {
this.onCreate();
};
Panel.prototype.__onDestroy__ = function () {
this.destroyed = true;
this.onDestroy();
};
Panel.prototype.__onShow__ = function () {
@@ -1101,6 +1103,9 @@ var Panel = /** @class */ (function () {
Panel.prototype.hookAfterNativeCall = function () {
var e_4, _a, e_5, _b;
var _this = this;
if (this.destroyed) {
return;
}
var promises = [];
if (Environment.platform !== 'web') {
//Here insert a native call to ensure the promise is resolved done.

View File

@@ -701,6 +701,7 @@ function NativeCall(target, propertyKey, descriptor) {
}
class Panel {
constructor() {
this.destroyed = false;
this.__root__ = new Root;
this.headviews = new Map;
this.onRenderFinishedCallback = [];
@@ -757,6 +758,7 @@ class Panel {
this.onCreate();
}
__onDestroy__() {
this.destroyed = true;
this.onDestroy();
}
__onShow__() {
@@ -819,6 +821,9 @@ class Panel {
}
}
hookAfterNativeCall() {
if (this.destroyed) {
return;
}
const promises = [];
if (Environment.platform !== 'web') {
//Here insert a native call to ensure the promise is resolved done.

View File

@@ -2160,6 +2160,7 @@ function NativeCall(target, propertyKey, descriptor) {
}
class Panel {
constructor() {
this.destroyed = false;
this.__root__ = new Root;
this.headviews = new Map;
this.onRenderFinishedCallback = [];
@@ -2216,6 +2217,7 @@ class Panel {
this.onCreate();
}
__onDestroy__() {
this.destroyed = true;
this.onDestroy();
}
__onShow__() {
@@ -2278,6 +2280,9 @@ class Panel {
}
}
hookAfterNativeCall() {
if (this.destroyed) {
return;
}
const promises = [];
if (Environment.platform !== 'web') {
//Here insert a native call to ensure the promise is resolved done.