From a145faad113a49da15c32381834e5cb15656f5fe Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Mon, 29 Jun 2009 03:47:10 +0000 Subject: [PATCH] Added fix suggested by George. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28375 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSTextView.m | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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"])