From 4dd7da00e0d3578876e8d474817ba4a800de1bc6 Mon Sep 17 00:00:00 2001 From: Wolfgang Lux Date: Sat, 27 Mar 2010 20:53:48 +0000 Subject: [PATCH] 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 --- ChangeLog | 7 +++++++ Source/NSWindowController.m | 2 ++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5177d42e5..70407f510 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-03-27 Wolfgang Lux + + * Source/NSWindowController.m (-_windowWillClose:): Extend + lifetime of the window controller to the end of the current event + cycle to prevent crashes due to a premature release after the + latest nib loading changes. + 2010-03-27 David Chisnall * Source/NSWindow.m diff --git a/Source/NSWindowController.m b/Source/NSWindowController.m index 4f95514ce..1497431a0 100644 --- a/Source/NSWindowController.m +++ b/Source/NSWindowController.m @@ -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); } } }