Hi all,
I’m having a strange error while running (debugging) my JUCE app,
i’ve been digging and trying for hours and can’t find any solution.
Basically, when I try to compile, then run my app in debug mode (or in release),
My application crashes with the call stack and error as shown in the attached screenshot image.
It seems to want to try to delete some cached images or something,
but i’ve no idea why it would do this.
Here’s a simplified view of my class, as you can see,
the bug occurs during a deep delete of a tree of classes,
and here’s where the error occurs, before it goes into the juce code,
eg, while deleting my std::vector of modules (not juce modules, my own ones).
the vector is properly loaded and all values are OK.
class PipeLineComponent : public WindowComponent
{
public:
PipeLineComponent(PipeLineTreeNode* pltn);
~PipeLineComponent() override {
for (int32 i = 0; i < pipeLineModules.size(); i++)
delete pipeLineModules[i]; < ------ BUG
};
void paint(juce::Graphics&) override;
void resized() override;
PipeLineTreeNode* pipeLineTreeNode;
std::vector<Module*> pipeLineModules;
};
On a side note,
I am using some images that I load from strings in separate C++ file,
converted using my pngtoascii tool for JUCE,
but these are simple class variables, not allocated with pointers,
and this class does not appear anywhere in the debugger’s call stack,
so I am not sure if it applies to the bug or not.
Just FYI, here is a simplified version of the class to show what images I’m using
elsewhere in the application:
class WindowComponent : public juce::Component
{
public:
WindowComponent();
~WindowComponent() {};
void PreLoadUIImages();
...
// Pre-Loaded Images
Image menuBarLeftSide;
Image menuBarCenterSide;
Image menuBarRightSide;
Image windowMaximizeButtonImage;
Image windowPanebackgroundImage;
};
void WindowComponent::PreLoadUIImages()
{
// Pre-load Images
menuBarLeftSide =
ImageFileFormat::loadFrom(eightk_panemenubar_left_png, eightk_panemenubar_left_pngSize);
menuBarCenterSide =
ImageFileFormat::loadFrom(eightk_panemenubar_center_png, eightk_panemenubar_center_pngSize);
menuBarRightSide =
ImageFileFormat::loadFrom(eightk_panemenubar_right_png, eightk_panemenubar_right_pngSize);
windowMaximizeButtonImage =
ImageFileFormat::loadFrom(eightk_panemenubar_maximize_png, eightk_panemenubar_maximize_pngSize);
windowPanebackgroundImage =
ImageFileFormat::loadFrom(eightk_panemenu_panebackground_png, eightk_panemenu_panebackground_pngSize);
}
void WindowComponent::drawWindowComponents(juce::Graphics& g,
const char* iconData, const int iconDataSize, bool bg_menubar_gradient)
{
// Draw Component’s menubar
if (menubarTop) {
//g.fillRect(0, 0, getWidth(), 24);
g.drawImage(menuBarLeftSide, 0, 0, 4, 28, 0, 0,
menuBarLeftSide.getWidth(),
menuBarLeftSide.getHeight());
g.drawImage(menuBarCenterSide, 4, 0, getWidth() - 4 - 4, 28, 0, 0,
menuBarCenterSide.getWidth(),
menuBarCenterSide.getHeight());
g.drawImage(menuBarRightSide, getWidth() - 4, 0, 4, 28, 0, 0,
menuBarRightSide.getWidth(),
menuBarRightSide.getHeight());
}
...
}
It would be great if someone here can provide some advice as I seem to be stuck at the moment…
Thank you!,
Terrence