Hello, everyone! I got problem when using the TabbedComponent, below is the MainContentComponent:
class MainContentComponent : public Component
{
public:
//==============================================================================
MainContentComponent()
: spTc(TabbedButtonBar::TabsAtTop)
{
spTc.addTab("Main", Colour(0xffeeddff), new TextButton("hello"), false);
addAndMakeVisible(spTc);
setSize(500, 400);
}
~MainContentComponent()
{
}
void paint(Graphics& g)
{
g.fillAll (Colour (0xffeeddff));
}
void resized()
{
spTc.setBounds(getBounds());
}
private:
TabbedComponent spTc;
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainContentComponent)
};
This code get an unhandled exception when exiting, The code crashed at juce_win32_Windowing.cpp Line 1643.
Then I changed the TabbedComponent spTc to SafePointer<TabbedComponent> spTc, and then the program get a memory leak of when exiting: *** Leaked objects detected: 1 instance(s) of class TabBarButton
How to use the TabbedComponent, can someone help me?
