Fix crash if content view is removed from window by moving it to another one.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23567 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-09-20 11:00:25 +00:00
parent 8bf4c36cc2
commit 9d21170e10
2 changed files with 20 additions and 0 deletions

View file

@ -123,6 +123,20 @@ struct NSWindow_struct
return self;
}
- (void) removeSubview: (NSView*)aView
{
RETAIN(aView);
/*
* If the content view is removed, we must let the window know.
*/
[super removeSubview: aView];
if (aView == [_window contentView])
{
[_window setContentView: nil];
}
RELEASE(aView);
}
- (void) setBackgroundColor: (NSColor *)color
{
[self setNeedsDisplayInRect: contentRect];