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

[iOS] Protect inner _styles, _attributes and copy them for returning … #2111

Merged
merged 1 commit into from
Feb 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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