diff --git a/ChangeLog b/ChangeLog index 009d71ec9..f4d8e36b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-28 23:46-EDT Gregory John Casamento + + * Source/NSTextView.m (-initWithCoder:): Retain the text + container and storage to prevent a crash since both are + autoreleased by the archiver. + 2009-06-29 Fred Kiefer * Headers/AppKit/NSKeyValueBinding.h, diff --git a/Source/NSTextView.m b/Source/NSTextView.m index daed59827..ada90ce7c 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -847,7 +847,7 @@ that makes decoding and encoding compatible with the old code. // currently not used.... if ([aDecoder containsValueForKey: @"NSTextStorage"]) { - _textStorage = [aDecoder decodeObjectForKey: @"NSTextStorage"]; + _textStorage = RETAIN([aDecoder decodeObjectForKey: @"NSTextStorage"]); } // currently not used.... @@ -864,7 +864,7 @@ that makes decoding and encoding compatible with the old code. [aTextContainer setWidthTracksTextView: YES]; [aTextContainer setHeightTracksTextView: NO]; */ - _textContainer = [aDecoder decodeObjectForKey: @"NSTextContainer"]; + _textContainer = RETAIN([aDecoder decodeObjectForKey: @"NSTextContainer"]); } if ([aDecoder containsValueForKey: @"NSTVFlags"])