Fix bug where a stray view could leak when changing the content view

of a window. This view then could make the title bar buttons
inaccessible when -gui handles window decorations.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@32163 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2011-02-14 22:11:26 +00:00
parent b07303eb41
commit 92da3e62d0

View file

@ -1160,7 +1160,14 @@ many times.
}
if (_contentView != nil)
{
[_contentView removeFromSuperview];
/* NB It is important to set _contentView to nil *before* removing
the content view from its superview. Otherwise, the window decoration
view would call back into this method with aView==nil and we would
leak a stray content view that may eventually hide the title bar
buttons when -gui handles window decorations. */
NSView *tmpView = _contentView;
_contentView = nil;
[tmpView removeFromSuperview];
}
_contentView = aView;