mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 23:31:02 +00:00
Small bug fixes for NSKeyValueBinding
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28367 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0f6d7e890d
commit
8ed4d5e90e
2 changed files with 15 additions and 6 deletions
|
@ -1,3 +1,10 @@
|
|||
2009-06-22 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSKeyValueBinding.m (GSKeyValueBinding+initialize):
|
||||
Correc the setup of the map tables.
|
||||
* Source/NSKeyValueBinding.m (GSKeyValueBinding+unbindAllForObject):
|
||||
Use a copy of the keys for the enumerator.
|
||||
|
||||
2009-06-05 18:21-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Headers/AppKit/NSSpeechSynthesizer.h:
|
||||
|
|
|
@ -141,9 +141,9 @@ void GSBindingInvokeAction(NSString *targetKey, NSString *argumentKey,
|
|||
{
|
||||
bindingLock = [GSLazyRecursiveLock new];
|
||||
classTable = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
|
||||
NSOwnedPointerMapValueCallBacks, 128);
|
||||
objectTable = NSCreateMapTable(NSNonOwnedPointerMapKeyCallBacks,
|
||||
NSOwnedPointerMapValueCallBacks, 128);
|
||||
NSObjectMapValueCallBacks, 128);
|
||||
objectTable = NSCreateMapTable(NSNonRetainedObjectMapKeyCallBacks,
|
||||
NSObjectMapValueCallBacks, 128);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -155,9 +155,9 @@ void GSBindingInvokeAction(NSString *targetKey, NSString *argumentKey,
|
|||
bindings = (NSMutableArray *)NSMapGet(classTable, (void*)clazz);
|
||||
if (bindings == nil)
|
||||
{
|
||||
// Need to retain it ourselves
|
||||
bindings = [[NSMutableArray alloc] initWithCapacity: 5];
|
||||
NSMapInsert(classTable, (void*)clazz, (void*)bindings);
|
||||
RELEASE(bindings);
|
||||
}
|
||||
[bindings addObject: binding];
|
||||
[bindingLock unlock];
|
||||
|
@ -249,13 +249,14 @@ void GSBindingInvokeAction(NSString *targetKey, NSString *argumentKey,
|
|||
list = (NSDictionary *)NSMapGet(objectTable, (void *)anObject);
|
||||
if (list != nil)
|
||||
{
|
||||
enumerator = [list keyEnumerator];
|
||||
NSArray *keys = [list allKeys];
|
||||
|
||||
enumerator = [keys objectEnumerator];
|
||||
while ((binding = [enumerator nextObject]))
|
||||
{
|
||||
[anObject unbind: binding];
|
||||
}
|
||||
NSMapRemove(objectTable, (void *)anObject);
|
||||
RELEASE(list);
|
||||
}
|
||||
[bindingLock unlock];
|
||||
}
|
||||
|
@ -297,6 +298,7 @@ void GSBindingInvokeAction(NSString *targetKey, NSString *argumentKey,
|
|||
{
|
||||
bindings = [NSMutableDictionary new];
|
||||
NSMapInsert(objectTable, (void*)source, (void*)bindings);
|
||||
RELEASE(bindings);
|
||||
}
|
||||
[bindings setObject: self forKey: name];
|
||||
[bindingLock unlock];
|
||||
|
|
Loading…
Reference in a new issue