Clean up the toolbar view of the old toolbar.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27482 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2008-12-31 17:36:35 +00:00
parent 326aaadef2
commit 04a95231a9
2 changed files with 13 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2008-12-31 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSWindow+Toolbar.m (-setToolbar:): Clean up the toolbar
view of the old toolbar.
2008-12-31 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSMenu.m

View file

@ -123,19 +123,21 @@
- (void) setToolbar: (NSToolbar*)toolbar
{
NSToolbar *lastToolbar = [self toolbar];
if (toolbar == lastToolbar)
if (toolbar == _toolbar)
return;
if (lastToolbar != nil)
if (_toolbar != nil)
{
GSToolbarView *toolbarView = [_toolbar _toolbarView];
// We throw the last toolbar out
if ([lastToolbar isVisible])
if ([_toolbar isVisible])
{
[self _toggleToolbarView];
}
// FIXME: Should release the toolbarView
[toolbarView _setToolbar: nil];
// Release the toolbarView, this will release the toolbar
RELEASE(toolbarView);
}
ASSIGN(_toolbar, toolbar);