Release the key value binding as it will be

retained in the binding table.
Leak found by static code analyser.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32484 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2011-03-07 13:35:37 +00:00
parent fcfa7dafb4
commit a953d2bda0
8 changed files with 87 additions and 43 deletions

View file

@ -1004,25 +1004,33 @@ static NSNotificationCenter *nc;
{
if ([binding isEqual: NSValueBinding])
{
GSKeyValueBinding *kvb;
[self unbind: binding];
// FIXME: We could also do the mapping via
// setKeys:triggerChangeNotificationsForDependentKey:
[[GSKeyValueBinding alloc] initWithBinding: @"objectValue"
withName: NSValueBinding
toObject: anObject
withKeyPath: keyPath
options: options
fromObject: self];
kvb = [[GSKeyValueBinding alloc] initWithBinding: @"objectValue"
withName: NSValueBinding
toObject: anObject
withKeyPath: keyPath
options: options
fromObject: self];
// The binding will be retained in the binding table
RELEASE(kvb);
}
else if ([binding hasPrefix: NSEnabledBinding])
{
GSKeyValueBinding *kvb;
[self unbind: binding];
[[GSKeyValueAndBinding alloc] initWithBinding: NSEnabledBinding
withName: binding
toObject: anObject
withKeyPath: keyPath
options: options
fromObject: self];
kvb = [[GSKeyValueAndBinding alloc] initWithBinding: NSEnabledBinding
withName: binding
toObject: anObject
withKeyPath: keyPath
options: options
fromObject: self];
// The binding will be retained in the binding table
RELEASE(kvb);
}
else
{