…In a new plug-in inititated by the Projucer. And the EmptyPanel as a member of editor and did an addAndMakeVisible(emptyPanel); in the editor constructor. But it appears the setSize is causing:
*** Leaked objects detected: 1 instance(s) of class StringArray
With a new instance of the StringArray error adding up everytime I open and close the editor from the DAW. What needs to be done please? And how to do I see the String it’s referring to, is it possible?
Sorry for all the questions lately… edit I’m using VS2017 with the latest develop code but I think this also occurred in the master release.
The leak counter is an assert statement, it only halts the execution, but it is safe to press continue. If you do that, you will most likely see other leaks as well. Did you try that? the other leaks (that may contain the StringArray, that happens to complain first) might give you a better clue about what is leaking.
The other thing is, I am not an OpenGL expert, but I think I would rather just use a standard Component and attach an OpenGLContext to it. I don’t see something directly related to JUCEApplication, but chances are, that the OpenGLAppComponent relies on mechanisms, that are not happening in a plugin.
I’ve been pressing continue for a week or so now. This is the only leak I have and it’s getting really annoying, TBH. The OpenGLAppComponent does all the things I want, including scaling properly in Windows with all the different scaling options, I’m a little cautious to change now I have three of them running nicely.
How do I find what’s in the StringArray in the asserting code?
Unfortunately it is hard, the leak detector finds it, because it is orphaned (not owned anywhere, otherwise it would be destroyed on stack unrolling).
But a first step is to add in every class the macro JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MyClass) (or one of the alternatives, there is JUCE_LEAK_DETECTOR (MyClass) for the ones you can copy as well).
Then you may find a leaking one, that contained your StringArray.
The JUCE classes should all have that macro, so if you find a class where it’s missing, please let the juce team know.
After a little further investigation this appears to be a VST3 only problem. Oh joy.
VST 2 and AAX versons have no jasserts - I haven’t tried MACOS yet…
…And everything appears to be OK on Mac. So basically it’s a Windows VST3 StringArray leak that only happens if I setSize or setBounds on an OpenGL Renderer.
It also needs an ‘addAndMakeVisible(emptyPanel);’ to go wrong.