Fix a problem where owner, firstResponder and application

were put in the list of top-level objects, creating a retain-cycle.  Fix a problem where view and window controllers did not release
their top-level objects as expected.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@36127 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Jonathan Gillaspie 2013-02-13 20:18:52 +00:00
parent 562a722ac1
commit b40571e9c5
4 changed files with 31 additions and 5 deletions

View file

@ -27,6 +27,7 @@
*/
#import <Foundation/NSBundle.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSEnumerator.h>
#import <Foundation/NSException.h>
@ -129,6 +130,10 @@
- (void) dealloc
{
// View Controllers are expect to release their own top-level objects
// https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html
[_top_level_objects makeObjectsPerformSelector:@selector(release)];
[self setWindow: nil];
RELEASE(_window_nib_name);
RELEASE(_window_nib_path);