Extend lifetime of a window controller to the end of the current event

cycle when its window is closed to prevent crashes due to a premature
release after the latest nib loading changes.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30051 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
wlux 2010-03-27 20:53:48 +00:00
parent 43f595f7f0
commit 6fe88f9e37
2 changed files with 9 additions and 0 deletions

View file

@ -261,6 +261,7 @@
nothing to do here. */
if ([_window isReleasedWhenClosed])
{
RETAIN(self);
if ([_window delegate] == self)
{
[_window setDelegate: nil];
@ -281,6 +282,7 @@
[self setWindow: nil];
[_document _removeWindowController: self];
AUTORELEASE(self);
}
}
}