* Source/NSTextView.m (-readSelectionFromPasteboard:type:): Fix

potential memory leak for colour pasting.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29992 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2010-03-17 09:36:19 +00:00
parent 6a14a009a2
commit 8b4249dddd
2 changed files with 9 additions and 4 deletions

View file

@ -2999,7 +2999,7 @@ Scroll so that the beginning of the range is visible.
return available != nil;
}
else
return NO;
return NO;
}
if (sel_eq(action, @selector(selectAll:))
@ -4606,14 +4606,14 @@ right.)
{
/* This is an attribute change, so we use a different range. */
NSRange aRange = [self rangeForUserCharacterAttributeChange];
NSColor *color = [NSColor colorFromPasteboard: pboard];
NSMutableDictionary *d = [[self typingAttributes] mutableCopy];
if (aRange.location != NSNotFound &&
[self shouldChangeTextInRange: aRange
replacementString: nil])
{
NSColor *color = [NSColor colorFromPasteboard: pboard];
NSMutableDictionary *d = [[self typingAttributes] mutableCopy];
[self setTextColor: color range: aRange];
[d setObject: color forKey: NSForegroundColorAttributeName];
[self setTypingAttributes: d];