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) {