Remove subviews AFTER next/previous key views have been cleaned up, in case any subviews were in the view chain

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29529 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Doug Simons 2010-02-09 22:05:25 +00:00
parent f47abd817f
commit 7868cd6332
2 changed files with 15 additions and 6 deletions

View file

@ -570,11 +570,6 @@ GSSetDragTypes(NSView* obj, NSArray *types)
// Remove all key value bindings for this view.
[GSKeyValueBinding unbindAllForObject: self];
while ([_sub_views count] > 0)
{
[[_sub_views lastObject] removeFromSuperviewWithoutNeedingDisplay];
}
/*
* Remove self from view chain. Try to mimic MacOS-X behavior ...
* We send setNextKeyView: messages to all view for which we are the
@ -669,6 +664,15 @@ GSSetDragTypes(NSView* obj, NSArray *types)
_nextKeyView = 0;
}
/*
* Now remove our subviews, AFTER cleaning up the view chain, in case
* any of our subviews were in the chain.
*/
while ([_sub_views count] > 0)
{
[[_sub_views lastObject] removeFromSuperviewWithoutNeedingDisplay];
}
RELEASE(_matrixToWindow);
RELEASE(_matrixFromWindow);
TEST_RELEASE(_frameMatrix);