Component destructor on TabbedComponent never gets called

I have a component added to a TabbedComponent, it has a simple destructor that for now just has one line to show a Dialog window

AlertWindow::showMessageBox (AlertWindow::InfoIcon, T("Info"), T("PanelGui1 destructor called"));

i have a button that deletes currently selected tab like so

TabbedBar *tabsPtr; /* class TabbedBar : public	TabbedComponent,
				  public	ChangeBroadcaster */

tabsPtr->removeTab (tabsPtr->getCurrentTabIndex());

the window never appears in the destructor, there is nothing additional (this is a VST plug), there are no adiitional threads the TabbedComponent has only this

[code]
#include <juce.h>

class TabbedBar : public TabbedComponent,
public ChangeBroadcaster
{
public:
TabbedBar (const TabbedButtonBar::Orientation orientation) : TabbedComponent (orientation)
{
}

	void currentTabChanged (const int newCurrentTabIndex, const String &newCurrentTabName);

};

[/code] in the .h file and this

[code]
#include “TabbedBar.h”

void TabbedBar::currentTabChanged (const int newCurrentTabIndex, const String &newCurrentTabName)
{
sendChangeMessage (getCurrentContentComponent ());
}
[/code] in the .cpp file.

I need to call the destructor and unregister all Listeners from components, otherwise i get crashes after the editor re-opening.

ps. small question, witch colourId is for the textColour on ToggleButton?

Could be any number of reasons why it’s not working for you - surely stepping through it in the debugger will easily show up what’s wrong?

And I think I only recently added the text colour id for a toggle button - it’ll be there in the next release. I’m still catching up with colour ids in a few places like that…

i have a problem with the debug build on MAC it’s that nasty __isfinite thing i can only build release, i’ll see what i can do on Win32