You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by jo...@apache.org on 2018/11/21 07:53:38 UTC
[incubator-weex] 01/01: Revert "Fix rc 0.20"
This is an automated email from the ASF dual-hosted git repository.
jondong pushed a commit to branch revert-1786-fix-rc-0.20
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git
commit b79bb7c47d1c19dd2f449f89008c46f70150c4cb
Author: Jonathan Dong <jo...@apache.org>
AuthorDate: Wed Nov 21 15:53:33 2018 +0800
Revert "Fix rc 0.20"
---
.../Sources/Component/WXCycleSliderComponent.mm | 3 -
.../Sources/Component/WXScrollerComponent.mm | 2 +-
ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.h | 30 +-------
ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m | 17 +----
.../WeexSDK/Sources/Layout/WXComponent+Layout.h | 72 +------------------
.../WeexSDK/Sources/Layout/WXComponent+Layout.mm | 80 ----------------------
ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.h | 7 +-
ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m | 26 ++-----
ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 13 +++-
ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m | 2 +-
.../Utility/WXThreadSafeMutableDictionary.m | 16 +----
weex_core/Source/core/layout/flex_enum.h | 8 +--
weex_core/Source/core/layout/layout.h | 2 +-
weex_core/Source/core/render/page/render_page.cpp | 8 ++-
14 files changed, 35 insertions(+), 251 deletions(-)
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm
index ab26bc3..402e592 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm
+++ b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.mm
@@ -73,9 +73,6 @@ typedef NS_ENUM(NSInteger, Direction) {
_currentIndex = 0;
_itemViews = [[NSMutableArray alloc] init];
_scrollView = [[WXRecycleSliderScrollView alloc] init];
- if (@available(iOS 11.0, *)) {
- _scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
- }
_scrollView.backgroundColor = [UIColor clearColor];
_scrollView.delegate = self;
_scrollView.showsHorizontalScrollIndicator = NO;
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm
index a278202..dfe8824 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm
+++ b/ios/sdk/WeexSDK/Sources/Component/WXScrollerComponent.mm
@@ -903,7 +903,7 @@ WX_EXPORT_METHOD(@selector(resetLoadmore))
}
if (!decelerate) {
_isScrolling = NO;
- [self performSelector:@selector(scrollViewDidEndDecelerating:) withObject:scrollView afterDelay:0.1];
+ [self performSelector:@selector(scrollViewDidEndDecelerating:) withObject:nil afterDelay:0.1];
}
NSHashTable *delegates = [_delegates copy];
diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.h b/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.h
index ac014a5..5e7b1e7 100644
--- a/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.h
+++ b/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.h
@@ -83,20 +83,6 @@
+ (void)registerService:(NSString *)name withScript:(NSString *)serviceScript withOptions:(NSDictionary *)options;
/**
- * @abstract Registers a component for a given name, options and js code
- *
- * @param name The service name to register
- *
- * @param options The service options to register
- *
- * @param serviceScript service js code to invoke
- *
- * @param completion Completion callback. JS is executed in asynchronously.
- *
- */
-+ (void)registerService:(NSString *)name withScript:(NSString *)serviceScript withOptions:(NSDictionary *)options completion:(void(^)(BOOL result))completion;
-
-/**
* @abstract Registers a component for a given name, options and js url
*
* @param name The service name to register
@@ -106,21 +92,7 @@
* @param serviceScriptUrl The service url to register
*
*/
-+ (void)registerService:(NSString *)name withScriptUrl:(NSURL *)serviceScriptUrl withOptions:(NSDictionary *)options;
-
-/**
- * @abstract Registers a component for a given name, options and js url
- *
- * @param name The service name to register
- *
- * @param options The service options to register
- *
- * @param serviceScriptUrl The service url to register
- *
- * @param completion Completion callback. JS is executed in asynchronously.
- *
- */
-+ (void)registerService:(NSString *)name withScriptUrl:(NSURL *)serviceScriptUrl withOptions:(NSDictionary *)options completion:(void(^)(BOOL result))completion;
++ (void)registerService:(NSString *)name withScriptUrl:(NSURL *)serviceScriptUrl WithOptions:(NSDictionary *)options;
/**
* @abstract Registers a component for a given name, options and js code
diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m b/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m
index 26ca8b7..b5d7e00 100644
--- a/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m
+++ b/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m
@@ -166,25 +166,14 @@
# pragma mark Service Register
-
+ (void)registerService:(NSString *)name withScript:(NSString *)serviceScript withOptions:(NSDictionary *)options
{
- [[WXSDKManager bridgeMgr] registerService:name withService:serviceScript withOptions:options completion:nil];
-}
-
-+ (void)registerService:(NSString *)name withScript:(NSString *)serviceScript withOptions:(NSDictionary *)options completion:(void(^)(BOOL result))completion
-{
- [[WXSDKManager bridgeMgr] registerService:name withService:serviceScript withOptions:options completion:completion];
-}
-
-+ (void)registerService:(NSString *)name withScriptUrl:(NSURL *)serviceScriptUrl withOptions:(NSDictionary *)options
-{
- [[WXSDKManager bridgeMgr] registerService:name withServiceUrl:serviceScriptUrl withOptions:options completion:nil];
+ [[WXSDKManager bridgeMgr] registerService:name withService:serviceScript withOptions:options];
}
-+ (void)registerService:(NSString *)name withScriptUrl:(NSURL *)serviceScriptUrl withOptions:(NSDictionary *)options completion:(void(^)(BOOL result))completion
++ (void)registerService:(NSString *)name withScriptUrl:(NSURL *)serviceScriptUrl WithOptions:(NSDictionary *)options
{
- [[WXSDKManager bridgeMgr] registerService:name withServiceUrl:serviceScriptUrl withOptions:options completion:completion];
+ [[WXSDKManager bridgeMgr] registerService:name withServiceUrl:serviceScriptUrl withOptions:options];
}
+ (void)unregisterService:(NSString *)name
diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h
index 7a7dc37..a338847 100644
--- a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h
+++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.h
@@ -26,13 +26,6 @@
#ifdef __cplusplus
#include "layout.h"
-typedef WeexCore::WXCoreFlexDirection WXCoreFlexDirection;
-typedef WeexCore::WXCoreFlexWrap WXCoreFlexWrap;
-typedef WeexCore::WXCoreJustifyContent WXCoreJustifyContent;
-typedef WeexCore::WXCoreAlignItems WXCoreAlignItems;
-typedef WeexCore::WXCoreAlignSelf WXCoreAlignSelf;
-typedef WeexCore::WXCorePositionType WXCorePositionType;
-
extern "C" {
#endif
bool flexIsUndefined(float value);
@@ -40,19 +33,6 @@ extern "C" {
}
#endif
-#ifndef __cplusplus
-// Ensure that .m files can use css style enum definitions.
-#include "flex_enum.h"
-
-typedef enum WXCoreFlexDirection WXCoreFlexDirection;
-typedef enum WXCoreFlexWrap WXCoreFlexWrap;
-typedef enum WXCoreJustifyContent WXCoreJustifyContent;
-typedef enum WXCoreAlignItems WXCoreAlignItems;
-typedef enum WXCoreAlignSelf WXCoreAlignSelf;
-typedef enum WXCorePositionType WXCorePositionType;
-
-#endif
-
@interface WXComponent ()
{
@package
@@ -71,60 +51,10 @@ typedef enum WXCorePositionType WXCorePositionType;
* @warning Subclasses must not override this.
*/
#ifdef __cplusplus
-@property (nonatomic, readonly, assign) WeexCore::WXCoreLayoutNode *flexCssNode;
+@property(nonatomic, readonly, assign) WeexCore::WXCoreLayoutNode *flexCssNode;
#endif
/**
- * @abstract Get css style value for key. The key should be of CSS standard form.
- * This method is for convenience use in C/ObjC environment. And if you want to
- * retrieve all style values or in C++, you could use flexCssNode directly.
- *
- * Thread usage:
- * This method should be invoked in component thread by WXPerformBlockOnComponentThread.
- * Note that all initWithRef methods of WXComponent and its subclasses are performed in
- * component thread by default. Therefore you can call this method directly in initWithRef.
- *
- * Supported keys:
- * width, height, min-width, min-height, max-width, max-height,
- * margin-(left/right/top/bottom)
- * padding-(left/right/top/bottom)
- * border-(left/right/top/bottom)-width
- * left, right, top, bottom
- * flex-grow
- */
-- (float)getCssStyleValueForKey:(NSString *)key;
-
-/**
- * @abstract Get css style flex-direction. Thread usage the same as getCssStyleValueForKey.
- */
-- (WXCoreFlexDirection)getCssStyleFlexDirection;
-
-/**
- * @abstract Get css style flex-wrap. Thread usage the same as getCssStyleValueForKey.
- */
-- (WXCoreFlexWrap)getCssStyleFlexWrap;
-
-/**
- * @abstract Get css style justify-content. Thread usage the same as getCssStyleValueForKey.
- */
-- (WXCoreJustifyContent)getCssStyleJustifyContent;
-
-/**
- * @abstract Get css style align-items. Thread usage the same as getCssStyleValueForKey.
- */
-- (WXCoreAlignItems)getCssStyleAlignItems;
-
-/**
- * @abstract Get css style align-self. Thread usage the same as getCssStyleValueForKey.
- */
-- (WXCoreAlignSelf)getCssStyleAlignSelf;
-
-/**
- * @abstract Get css style position. Thread usage the same as getCssStyleValueForKey.
- */
-- (WXCorePositionType)getCssStylePositionType;
-
-/**
* @abstract Convert layout dimension value like 'left', 'width' to style value in js considering viewport and scale.
*/
- (NSString*)convertLayoutValueToStyleValue:(NSString*)valueName;
diff --git a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm
index 8afd225..18cb24d 100644
--- a/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm
+++ b/ios/sdk/WeexSDK/Sources/Layout/WXComponent+Layout.mm
@@ -366,86 +366,6 @@ bool flexIsUndefined(float value) {
return defaultValue;
}
-- (float)getCssStyleValueForKey:(NSString *)key
-{
- /*
- * width, height, min-width, min-height, max-width, max-height,
- * margin-(left/right/top/bottom)
- * padding-(left/right/top/bottom)
- * border-(left/right/top/bottom)-width
- * left, right, top, bottom
- * flex-grow
- */
- WXAssert(_flexCssNode != nullptr, @"Css node is null.");
- if (_flexCssNode == nullptr) {
- return NAN;
- }
-
- std::string ckey = [key UTF8String];
- if (ckey == "width") return _flexCssNode->getStyleWidth();
- if (ckey == "height") return _flexCssNode->getStyleHeight();
- if (ckey == "min-width") return _flexCssNode->getMinWidth();
- if (ckey == "min-height") return _flexCssNode->getMinHeight();
- if (ckey == "max-width") return _flexCssNode->getMaxWidth();
- if (ckey == "max-height") return _flexCssNode->getMaxHeight();
- if (ckey == "margin-left") return _flexCssNode->getMarginLeft();
- if (ckey == "margin-right") return _flexCssNode->getMarginRight();
- if (ckey == "margin-top") return _flexCssNode->getMarginTop();
- if (ckey == "margin-bottom") return _flexCssNode->getMarginBottom();
- if (ckey == "padding-left") return _flexCssNode->getPaddingLeft();
- if (ckey == "padding-right") return _flexCssNode->getPaddingRight();
- if (ckey == "padding-top") return _flexCssNode->getPaddingTop();
- if (ckey == "padding-bottom") return _flexCssNode->getPaddingBottom();
- if (ckey == "border-left-width") return _flexCssNode->getBorderWidthLeft();
- if (ckey == "border-right-width") return _flexCssNode->getBorderWidthRight();
- if (ckey == "border-top-width") return _flexCssNode->getBorderWidthTop();
- if (ckey == "border-bottom-width") return _flexCssNode->getBorderWidthBottom();
- if (ckey == "left") return _flexCssNode->getStylePositionLeft();
- if (ckey == "right") return _flexCssNode->getStylePositionRight();
- if (ckey == "top") return _flexCssNode->getStylePositionTop();
- if (ckey == "bottom") return _flexCssNode->getStylePositionBottom();
- if (ckey == "flex-grow") return _flexCssNode->getFlex();
-
- WXAssert(NO, @"Invalid css style key %@", key);
- return NAN;
-}
-
-- (WXCoreFlexDirection)getCssStyleFlexDirection
-{
- WXAssert(_flexCssNode != nullptr, @"Css node is null.");
- return _flexCssNode ? _flexCssNode->getFlexDirection() : kFlexDirectionColumn;
-}
-
-- (WXCoreFlexWrap)getCssStyleFlexWrap
-{
- WXAssert(_flexCssNode != nullptr, @"Css node is null.");
- return _flexCssNode ? _flexCssNode->getFlexWrap() : kNoWrap;
-}
-
-- (WXCoreJustifyContent)getCssStyleJustifyContent
-{
- WXAssert(_flexCssNode != nullptr, @"Css node is null.");
- return _flexCssNode ? _flexCssNode->getJustifyContent() : kJustifyFlexStart;
-}
-
-- (WXCoreAlignItems)getCssStyleAlignItems
-{
- WXAssert(_flexCssNode != nullptr, @"Css node is null.");
- return _flexCssNode ? _flexCssNode->getAlignItems() : kAlignItemsStretch;
-}
-
-- (WXCoreAlignSelf)getCssStyleAlignSelf
-{
- WXAssert(_flexCssNode != nullptr, @"Css node is null.");
- return _flexCssNode ? _flexCssNode->getAlignSelf() : kAlignSelfAuto;
-}
-
-- (WXCorePositionType)getCssStylePositionType
-{
- WXAssert(_flexCssNode != nullptr, @"Css node is null.");
- return _flexCssNode ? _flexCssNode->getStylePositionType() : kRelative;
-}
-
- (NSString*)convertLayoutValueToStyleValue:(NSString*)valueName
{
if (_flexCssNode == nullptr) {
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.h b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.h
index 8728161..3d06277 100644
--- a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.h
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.h
@@ -102,9 +102,8 @@ extern void WXPerformBlockOnBridgeThread(void (^block)(void));
* @param name : service name
* @param serviceScript : script code
* @param options : service options
- * @param completion : completion callback
**/
-- (void)registerService:(NSString *)name withService:(NSString *)serviceScript withOptions:(NSDictionary *)options completion:(void(^)(BOOL result))completion;
+- (void)registerService:(NSString *)name withService:(NSString *)serviceScript withOptions:(NSDictionary *)options;
/**
@@ -112,9 +111,9 @@ extern void WXPerformBlockOnBridgeThread(void (^block)(void));
* @param name : service name
* @param serviceScriptUrl : script url
* @param options : service options
- * @param completion : completion callback
**/
--(void)registerService:(NSString *)name withServiceUrl:(NSURL *)serviceScriptUrl withOptions:(NSDictionary *)options completion:(void(^)(BOOL result))completion;
+
+-(void)registerService:(NSString *)name withServiceUrl:(NSURL *)serviceScriptUrl withOptions:(NSDictionary *)options;
/**
* Unregister JS service Script
diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m
index f5c7a47..a0e8e4e 100644
--- a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m
+++ b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m
@@ -288,41 +288,28 @@ void WXPerformBlockSyncOnBridgeThread(void (^block) (void))
return value;
}
-- (void)registerService:(NSString *)name withServiceUrl:(NSURL *)serviceScriptUrl withOptions:(NSDictionary *)options completion:(void(^)(BOOL result))completion
+-(void)registerService:(NSString *)name withServiceUrl:(NSURL *)serviceScriptUrl withOptions:(NSDictionary *)options
{
- if (!name || !serviceScriptUrl || !options) {
- if (completion) {
- completion(NO);
- }
- return;
- }
+ if (!name || !serviceScriptUrl || !options) return;
__weak typeof(self) weakSelf = self;
WXResourceRequest *request = [WXResourceRequest requestWithURL:serviceScriptUrl resourceType:WXResourceTypeServiceBundle referrer:@"" cachePolicy:NSURLRequestUseProtocolCachePolicy];
WXResourceLoader *serviceBundleLoader = [[WXResourceLoader alloc] initWithRequest:request];;
serviceBundleLoader.onFinished = ^(WXResourceResponse *response, NSData *data) {
__strong typeof(weakSelf) strongSelf = weakSelf;
NSString *jsServiceString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- [strongSelf registerService:name withService:jsServiceString withOptions:options completion:completion];
+ [strongSelf registerService:name withService:jsServiceString withOptions:options];
};
serviceBundleLoader.onFailed = ^(NSError *loadError) {
WXLogError(@"No script URL found");
- if (completion) {
- completion(NO);
- }
};
[serviceBundleLoader start];
}
-- (void)registerService:(NSString *)name withService:(NSString *)serviceScript withOptions:(NSDictionary *)options completion:(void(^)(BOOL result))completion
+- (void)registerService:(NSString *)name withService:(NSString *)serviceScript withOptions:(NSDictionary *)options
{
- if (!name || !serviceScript || !options) {
- if (completion) {
- completion(NO);
- }
- return;
- }
+ if (!name || !serviceScript || !options) return;
NSString *script = [WXServiceFactory registerServiceScript:name withRawScript:serviceScript withOptions:options];
@@ -331,9 +318,6 @@ void WXPerformBlockSyncOnBridgeThread(void (^block) (void))
// save it when execute
[WXDebugTool cacheJsService:name withScript:serviceScript withOptions:options];
[weakSelf.bridgeCtx executeJsService:script withName:name];
- if (completion) {
- completion(YES);
- }
});
}
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
index 613abd5..87bc326 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
@@ -78,6 +78,7 @@ typedef enum : NSUInteger {
BOOL _debugJS;
id<WXBridgeProtocol> _instanceJavaScriptContext; // sandbox javaScript context
CGFloat _defaultPixelScaleFactor;
+ BOOL _bReleaseInstanceInMainThread;
BOOL _defaultDataRender;
}
@@ -117,6 +118,7 @@ typedef enum : NSUInteger {
_apmInstance = [[WXApmForInstance alloc] init];
_defaultPixelScaleFactor = CGFLOAT_MIN;
+ _bReleaseInstanceInMainThread = YES;
_defaultDataRender = NO;
[self addObservers];
@@ -441,6 +443,9 @@ typedef enum : NSUInteger {
BOOL useJSCApiForCreateInstance = [[configCenter configForKey:@"iOS_weex_ext_config.useJSCApiForCreateInstance" defaultValue:@(YES) isDefault:NULL] boolValue];
[WXUtility setUseJSCApiForCreateInstance:useJSCApiForCreateInstance];
+
+ //Reading config from orange for Release instance in Main Thread or not
+ _bReleaseInstanceInMainThread = [[configCenter configForKey:@"iOS_weex_ext_config.releaseInstanceInMainThread" defaultValue:@(YES) isDefault:nil] boolValue];
BOOL shoudMultiContext = NO;
shoudMultiContext = [[configCenter configForKey:@"iOS_weex_ext_config.createInstanceUsingMutliContext" defaultValue:@(YES) isDefault:NULL] boolValue];
@@ -654,9 +659,13 @@ typedef enum : NSUInteger {
[WXCoreBridge closePage:instanceId];
// Reading config from orange for Release instance in Main Thread or not, for Bug #15172691 +{
- dispatch_async(dispatch_get_main_queue(), ^{
+ if (!_bReleaseInstanceInMainThread) {
[WXSDKManager removeInstanceforID:instanceId];
- });
+ } else {
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [WXSDKManager removeInstanceforID:instanceId];
+ });
+ }
//+}
});
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
index 75b09d8..70a8feb 100644
--- a/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
+++ b/ios/sdk/WeexSDK/Sources/Module/WXAnimationModule.m
@@ -123,7 +123,7 @@
_animationInfo.target.view.layer.anchorPoint = _animationInfo.originAnchorPoint;
_animationInfo.target.view.layer.frame = originFrame;
}
- [_animationInfo.target.layer removeAnimationForKey:_animationInfo.propertyName];
+ [_animationInfo.target.layer removeAllAnimations];
if (_finishBlock) {
_finishBlock(flag);
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.m b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.m
index 6f31fb9..3c32292 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXThreadSafeMutableDictionary.m
@@ -145,30 +145,24 @@
- (void)setObject:(id)anObject forKey:(id<NSCopying>)aKey
{
- id originalObject = nil; // make sure that object is not released in lock
@try {
pthread_mutex_lock(&_safeThreadDictionaryMutex);
- originalObject = [_dict objectForKey:aKey];
[_dict setObject:anObject forKey:aKey];
}
@finally {
pthread_mutex_unlock(&_safeThreadDictionaryMutex);
}
- originalObject = nil;
}
- (void)setObject:(id)anObject forKeyedSubscript:(id <NSCopying>)key
{
- id originalObject = nil; // make sure that object is not released in lock
@try {
pthread_mutex_lock(&_safeThreadDictionaryMutex);
- originalObject = [_dict objectForKey:key];
[_dict setObject:anObject forKeyedSubscript:key];
}
@finally {
pthread_mutex_unlock(&_safeThreadDictionaryMutex);
}
- originalObject = nil;
}
- (NSArray *)allKeys
@@ -195,32 +189,24 @@
- (void)removeObjectForKey:(id)aKey
{
- id originalObject = nil; // make sure that object is not released in lock
@try {
pthread_mutex_lock(&_safeThreadDictionaryMutex);
- originalObject = [_dict objectForKey:aKey];
- if (originalObject) {
- [_dict removeObjectForKey:aKey];
- }
+ [_dict removeObjectForKey:aKey];
}
@finally {
pthread_mutex_unlock(&_safeThreadDictionaryMutex);
}
- originalObject = nil;
}
- (void)removeAllObjects
{
- NSArray* allValues = nil; // make sure that objects are not released in lock
@try {
pthread_mutex_lock(&_safeThreadDictionaryMutex);
- allValues = [_dict allValues];
[_dict removeAllObjects];
}
@finally {
pthread_mutex_unlock(&_safeThreadDictionaryMutex);
}
- allValues = nil;
}
- (id)copy
diff --git a/weex_core/Source/core/layout/flex_enum.h b/weex_core/Source/core/layout/flex_enum.h
index 7e439b2..9eb3676 100644
--- a/weex_core/Source/core/layout/flex_enum.h
+++ b/weex_core/Source/core/layout/flex_enum.h
@@ -16,14 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
+#ifdef __cplusplus
#ifndef WEEXCORE_FLEXLAYOUT_WXCOREFLEXENUM_H
#define WEEXCORE_FLEXLAYOUT_WXCOREFLEXENUM_H
-/* These enum definitions may also be used by C files. */
-#ifdef __cplusplus
namespace WeexCore {
-#endif
/**
* MainAxis direction
@@ -122,8 +120,6 @@ namespace WeexCore {
kLeft,
};
-#ifdef __cplusplus
}
-#endif
-
#endif //WEEXCORE_FLEXLAYOUT_WXCOREFLEXENUM_H
+#endif
\ No newline at end of file
diff --git a/weex_core/Source/core/layout/layout.h b/weex_core/Source/core/layout/layout.h
index 4b8f0c5..0d62edd 100644
--- a/weex_core/Source/core/layout/layout.h
+++ b/weex_core/Source/core/layout/layout.h
@@ -836,7 +836,7 @@ namespace WeexCore {
}
}
- inline WXCorePositionType getStylePositionType() const {
+ inline WXCorePositionType getStypePositionType() const {
return mCssStyle->mPositionType;
}
diff --git a/weex_core/Source/core/render/page/render_page.cpp b/weex_core/Source/core/render/page/render_page.cpp
index 119af87..032a0d7 100644
--- a/weex_core/Source/core/render/page/render_page.cpp
+++ b/weex_core/Source/core/render/page/render_page.cpp
@@ -628,11 +628,13 @@ void RenderPage::Batch() {
if ((kUseVSync && this->need_layout_.load()) || !kUseVSync) {
LayoutInner();
}
+ else {
#if OS_IOS
- // vsync may stopped, trigger once
- RenderAction *action = new RenderActionTriggerVSync(page_id());
- PostRenderAction(action);
+ // vsync may stopped, trigger once
+ RenderAction *action = new RenderActionTriggerVSync(page_id());
+ PostRenderAction(action);
#endif
+ }
}
RenderObject *RenderPage::GetRenderObject(const std::string &ref) {