Prevent accidental deallocation of contentView in custom window subclass.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21509 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2005-07-21 12:29:24 +00:00
parent 23a1eb2f02
commit 07a3bffbc4
2 changed files with 8 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2005-07-21 08:33 Gregory John Casamento <greg_casamento@yahoo.com>
* Source/GSNibTemplates.m: in GSWindowTemplate initWithCoder:,
temporarily retain, then release (after setting back into the window)
the content view to prevent it from being inadvertantly deallocated.
2005-07-17 Adam Fedor <fedor@gnu.org>
* Source/NSApplication.m (gnustep_backend_path,

View file

@ -840,6 +840,7 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
// if we are not in an interface builder, call
// designated initializer per spec...
RETAIN(contentView); // prevent view from being deallocated.
obj = [obj initWithContentRect: [contentView frame]
styleMask: [obj styleMask]
backing: [obj backingType]
@ -847,6 +848,7 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
// set the content view back
[obj setContentView: contentView];
RELEASE(contentView); // release view.
}
// autoposition window