You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by cx...@apache.org on 2017/03/29 12:13:44 UTC

[17/39] incubator-weex git commit: * [ios] bug fix: box shadow release refer to https://github.com/gnustep/quartzcore/blob/master/Source/CALayer.m

* [ios] bug fix: box shadow  release  refer to https://github.com/gnustep/quartzcore/blob/master/Source/CALayer.m


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/34927732
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/34927732
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/34927732

Branch: refs/heads/0.12-dev
Commit: 3492773263ca93c49bc3807556078407f2f1dc23
Parents: b31abe8
Author: kfeagle <su...@163.com>
Authored: Mon Mar 27 20:57:59 2017 +0800
Committer: kfeagle <su...@163.com>
Committed: Mon Mar 27 20:57:59 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/34927732/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m b/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m
index aae9f81..5c6bf4a 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m
@@ -12,12 +12,16 @@
 
 @implementation WXBoxShadow
 
+- (void) dealloc
+{
+    CGColorRelease(_shadowColor);
+}
+
 - (instancetype)init
 {
     self = [super init];
     
     if (self) {
-        self.shadowColor = [UIColor whiteColor].CGColor;
         self.shadowRadius = 0.0f;
         self.isInset = NO;
         self.shadowOffset = CGSizeZero;
@@ -27,6 +31,18 @@
     return self;
 }
 
+
+- (void)setShadowColor: (CGColorRef)shadowColor
+{
+    if (shadowColor == _shadowColor)
+    return;
+    
+    CGColorRetain(shadowColor);
+    CGColorRelease(_shadowColor);
+    _shadowColor = shadowColor;
+}
+
+
 + (NSArray *)getBoxShadowElementsByBlank:(NSString *)string
 {
     string = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];