Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[iOS] Protect inner _styles, _attributes and copy them for returning …
Browse files Browse the repository at this point in the history
…values. (#2111)
  • Loading branch information
wqyfavor authored and doumafang committed Feb 12, 2019
1 parent e401433 commit a3111ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ios/sdk/WeexSDK/Sources/Model/WXComponent.mm
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ - (NSDictionary *)styles
{
NSDictionary *styles;
pthread_mutex_lock(&_propertyMutex);
styles = _styles;
styles = [_styles copy];
pthread_mutex_unlock(&_propertyMutex);
return styles;
}
Expand All @@ -287,7 +287,7 @@ - (NSDictionary *)pseudoClassStyles
{
NSDictionary *pseudoClassStyles;
pthread_mutex_lock(&_propertyMutex);
pseudoClassStyles = _pseudoClassStyles;
pseudoClassStyles = [_pseudoClassStyles copy];
pthread_mutex_unlock(&_propertyMutex);

return pseudoClassStyles;
Expand All @@ -302,7 +302,7 @@ - (NSDictionary *)attributes
{
NSDictionary *attributes;
pthread_mutex_lock(&_propertyMutex);
attributes = _attributes;
attributes = [_attributes copy];
pthread_mutex_unlock(&_propertyMutex);

return attributes;
Expand Down

0 comments on commit a3111ee

Please sign in to comment.