You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by gu...@apache.org on 2017/09/26 02:20:34 UTC
[37/51] [abbrv] incubator-weex git commit: * [ios] post notification
when sdk instance destroy
* [ios] post notification when sdk instance destroy
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/0753f504
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/0753f504
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/0753f504
Branch: refs/heads/dev
Commit: 0753f504d55116e46a69b0360657cdebc615bbe3
Parents: 9fe39ad
Author: acton393 <zh...@gmail.com>
Authored: Mon Sep 25 10:53:20 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Mon Sep 25 21:17:37 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 3 +++
ios/sdk/WeexSDK/Sources/Utility/WXDefine.h | 2 ++
2 files changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0753f504/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 39645ca..2afcf46 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
@@ -356,6 +356,9 @@ typedef enum : NSUInteger {
WXLogError(@"Fail to find instanceļ¼");
return;
}
+
+ [[NSNotificationCenter defaultCenter] postNotificationName:WX_INSTANCE_WILL_DESTROY_NOTIFICATION object:nil userInfo:@{@"instanceId":self.instanceId}];
+
[WXTracingManager destroyTraincgTaskWithInstance:self.instanceId];
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/0753f504/ios/sdk/WeexSDK/Sources/Utility/WXDefine.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXDefine.h b/ios/sdk/WeexSDK/Sources/Utility/WXDefine.h
index 6fd5781..0867e99 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXDefine.h
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXDefine.h
@@ -81,6 +81,8 @@ parts = [parts subarrayWithRange:(NSRange){0, parts.count - 1}];\
#define WX_COMPONENT_NOTIFICATION_VIEW_LOADED @"WXComponentViewLoaded"
+#define WX_INSTANCE_WILL_DESTROY_NOTIFICATION @"WXSDKInstanceWillDestroyNotification"
+
#define WX_SDKINSTANCE_WILL_RENDER @"WXSDKInstanceWillRender"
#define WX_COMPONENT_THREAD_NAME @"com.taobao.weex.component"