mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2024-12-04 18:18:17 +00:00
Fix for KVC memory leak; found by Dirk Theisen
This commit is contained in:
parent
2b7e272164
commit
78c737cd18
@ -47,7 +47,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
-(id)_representedObject
|
||||
{
|
||||
if(accessor)
|
||||
{
|
||||
return accessor(proxyObject, accessorSel);
|
||||
}
|
||||
return [proxyObject valueForKey:key];
|
||||
}
|
||||
|
||||
@ -96,7 +98,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
- (void)insertObject:(id)anObject atIndex:(unsigned)index;
|
||||
{
|
||||
if(insert)
|
||||
{
|
||||
insert(proxyObject, insertSel, anObject, index);
|
||||
}
|
||||
else
|
||||
{
|
||||
id target=[[self _representedObject] mutableCopy];
|
||||
|
@ -181,6 +181,7 @@ static NSLock *kvoLock=nil;
|
||||
[dict setObject:[NSNumber numberWithInt:NSKeyValueChangeSetting]
|
||||
forKey:NSKeyValueChangeKindKey];
|
||||
[self _willChangeValueForKey:key changeOptions:dict];
|
||||
[dict release];
|
||||
}
|
||||
|
||||
-(void)didChangeValueForKey:(NSString*)key
|
||||
@ -196,6 +197,7 @@ static NSLock *kvoLock=nil;
|
||||
[dict setObject:indexes
|
||||
forKey:NSKeyValueChangeIndexesKey];
|
||||
[self _willChangeValueForKey:key changeOptions:dict];
|
||||
[dict release];
|
||||
}
|
||||
|
||||
- (void)didChange:(NSKeyValueChange)change valuesAtIndexes:(NSIndexSet *)indexes forKey:(NSString *)key
|
||||
|
Loading…
Reference in New Issue
Block a user