Repository: incubator-weex Updated Branches: refs/heads/master 8ac198a22 -> 2539b94ff
[WEEX-375][iOS] bugfix about page event call in destroyinstance Bug:375 Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/2539b94f Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/2539b94f Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/2539b94f Branch: refs/heads/master Commit: 2539b94ff88becf1c82f613ad6cc55538556e84a Parents: 8ac198a Author: acton393 <zhangxing610...@gmail.com> Authored: Fri May 18 10:27:53 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Fri May 18 10:27:53 2018 +0800 ---------------------------------------------------------------------- ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/2539b94f/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m index 88a63f9..3e4f972 100644 --- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m +++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m @@ -267,7 +267,7 @@ typedef enum : NSUInteger { } id<WXPageEventNotifyEventProtocol> pageEvent = [WXSDKEngine handlerForProtocol:@protocol(WXPageEventNotifyEventProtocol)]; - if ([pageEvent respondsToSelector:@selector(pageDestroy:)]) { + if ([pageEvent respondsToSelector:@selector(pageStart:)]) { [pageEvent pageStart:self.instanceId]; } @@ -482,7 +482,11 @@ typedef enum : NSUInteger { WXLogError(@"Fail to find instanceï¼"); return; } - + + id<WXPageEventNotifyEventProtocol> pageEvent = [WXSDKEngine handlerForProtocol:@protocol(WXPageEventNotifyEventProtocol)]; + if ([pageEvent respondsToSelector:@selector(pageDestroy:)]) { + [pageEvent pageDestroy:self.instanceId]; + } [[NSNotificationCenter defaultCenter] postNotificationName:WX_INSTANCE_WILL_DESTROY_NOTIFICATION object:nil userInfo:@{@"instanceId":self.instanceId}]; [WXTracingManager destroyTraincgTaskWithInstance:self.instanceId];