Is it possable to have tabed Components with in Tab Componen

I’ve got it build but i’m getting horrable memory leaks

really? What’s leaking?

Remember that when you implement createPanelComponentForTab() you tell it whether to delete the component later on. If you tell it not to, then when the tabbed component is deleted, it won’t clear up its current panel component.

yes i used the componentCanBeDeleted = true; first thing in that method.
i also took some ques from your demo program where you created a component that deletesAllChildren() but i’m getting the leaks when i try to use a tabbedComponent as a panel with in another tabbedCompoent is there any particular way i need to set this up?


Putting one inside another is no different to using any other component - there’s nothing special going on.

You must just be not deleting a child component somewhere. If you’re on windows and you’ve added the juce_useDebugNew macro to your classes then it should be easy to see which comps are being leaked.

I’ve been doing some tests. It looks like the memory leak “at least one of them” is started with a lookAndFeel class I’m using to size the tabs by overriding the getTabButtonBestWidth() Method. My goal is to have the tabs spread themselves across the width of the app automatically. but for the time being I’ve just been returning a static int to experiment with the tab sizes.

juce_useDebugNew?? havn’t seen that one before how is it used?

Try using haydxn’s memory counter debugger thingy from this thread.

Ok after doing some research and basically starting from scratch I’ve found that the cause of the memory leaks is the LookandFeel class. If i try to inherit the LookandFeel class and use it with any thing with in a Tab i get a memory leak!! has somthing changed in the LookandFeel class since juce version 1.15???

Do you mean that the LF object itself is getting leaked? If so, that’s true, because they’re not deleted automatically by anything. If you create one temporarily for a component, you’ll need to make sure you also delete it when it’s no longer needed.