From c3c507203b0f9b17cacf6903a5fd50f65cd2f612 Mon Sep 17 00:00:00 2001 From: fredkiefer Date: Sat, 15 Dec 2007 14:36:28 +0000 Subject: [PATCH] Two small bug fixes. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25748 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSControl.m | 14 ++++++++------ Source/NSImage.m | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7286a2608..3fcf0389b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-12-15 Fred Kiefer + + * Source/NSControl.m (-bind:...options:): Correct value binding. + * Source/NSImage.m (+imageNamed:): Don't release, autorelease the image. + 2007-12-15 Fred Kiefer * Source/NSTextField.m: Move some KVB to NSControl, add binding diff --git a/Source/NSControl.m b/Source/NSControl.m index 70995a855..5cad1ce4d 100644 --- a/Source/NSControl.m +++ b/Source/NSControl.m @@ -975,12 +975,14 @@ static NSNotificationCenter *nc; if ([binding isEqual: NSValueBinding]) { [self unbind: binding]; - [[GSKeyValueOrBinding alloc] initWithBinding: @"objectValue" - withName: NSValueBinding - toObject: anObject - withKeyPath: keyPath - options: options - fromObject: self]; + // FIXME: We could also do the mapping via + // setKeys:triggerChangeNotificationsForDependentKey: + [[GSKeyValueBinding alloc] initWithBinding: @"objectValue" + withName: NSValueBinding + toObject: anObject + withKeyPath: keyPath + options: options + fromObject: self]; } else if ([binding hasPrefix: NSEnabledBinding]) { diff --git a/Source/NSImage.m b/Source/NSImage.m index 150061ccc..312ebc724 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -288,7 +288,7 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep) if (image != nil) { [image setName: aName]; - RELEASE(image); // Retained in dictionary. + AUTORELEASE(image); image->_flags.archiveByName = YES; } return image;