From 6b36858f26dfc5e2991b3d7864f40a45283563fb Mon Sep 17 00:00:00 2001 From: Paul Zabelin Date: Sat, 19 Apr 2014 02:33:11 -0700 Subject: [PATCH] fix analyzer warnings: The left operand of '==' is a garbage value Nil value used as mutex for @synchronized() (no synchronization will occur) --- Classes/DPPPropertyAttribute.m | 2 +- Classes/NSObject+DProperty.m | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Classes/DPPPropertyAttribute.m b/Classes/DPPPropertyAttribute.m index 58a8fd2..25c4233 100644 --- a/Classes/DPPPropertyAttribute.m +++ b/Classes/DPPPropertyAttribute.m @@ -26,7 +26,7 @@ - (id) initWithClass:(id)class propertyName:(NSString*)propertyName return self; const char *p = attrs; - char retentionMethod; + char retentionMethod = 0; BOOL atomic = YES; BOOL weak = NO; do diff --git a/Classes/NSObject+DProperty.m b/Classes/NSObject+DProperty.m index 79dc9e0..800dd6b 100644 --- a/Classes/NSObject+DProperty.m +++ b/Classes/NSObject+DProperty.m @@ -208,12 +208,10 @@ + (NSMutableDictionary*)DPP_keysDictionary { NSMutableDictionary *dict = objc_getAssociatedObject(self, &DPPPropertyDictionaryKey); if(dict == nil){ - @synchronized(dict){ - dict = objc_getAssociatedObject(self, &DPPPropertyDictionaryKey); - if(dict == nil){ - dict = [NSMutableDictionary dictionary]; - self.DPP_keysDictionary = dict; - } + dict = objc_getAssociatedObject(self, &DPPPropertyDictionaryKey); + if(dict == nil){ + dict = [NSMutableDictionary dictionary]; + self.DPP_keysDictionary = dict; } } return dict;