From 0192ecd4dd6ae20f2da973d7d7121ff9dc92d3d4 Mon Sep 17 00:00:00 2001 From: fredkiefer Date: Wed, 14 May 2008 22:56:13 +0000 Subject: [PATCH] Try to better solve the circular reference between the window and the context. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26527 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSWindow.m | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 79b4f17ef..b37c9e178 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-15 Fred Kiefer + + * Source/NSWindow.m: (-dealloc): Try to better cope with the + circular reference between the window and the context. + 2008-05-14 Richard Frith-Macdonald * Source/NSDocumentController.m: Cope with bad values in NSRecentItems diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 1fe57e454..39a55a063 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -783,7 +783,16 @@ many times. */ [GSServerForWindow(self) removeDragTypes: nil fromWindow: self]; - [self _terminateBackendWindow]; + if (_windowNum) + { + /* If there was a context, clear it and let it remove the + window in that process. We get here again, but without a + _windowNum. This indirection is needed so solve the circular + references between the window and the context. + */ + [self _terminateBackendWindow]; + return; + } if (_delegate != nil) {