DialogWindow memory allocation error

Hi all,

I'm using a DialogWindow to load a component that at certain point has to access a SQLite database.

When the component tries to access the database, it gives me memory allocation error.

I'm calling the component this way:


String m;
m << "";

DialogWindow::LaunchOptions options;

Label* label = new Label();
label->setText(m, dontSendNotification);
label->setColour(Label::textColourId, Colours::darkgrey);
Rectangle<int> area(0, 0, 378, 407);

options.content->setSize(area.getWidth(), area.getHeight());
options.dialogTitle = "Login Window";
options.dialogBackgroundColour = Colours::darkgrey;
options.escapeKeyTriggersCloseButton = true;
options.useNativeTitleBar = false;
options.resizable = false;

DialogWindow* dw = options.launchAsync();
dw->setContentOwned(showLoginPage(), true);
dw->centreWithSize(378, 407);

I know that to call the DialogWindow i'm creating a label that will not be used. But i did not find a way to put the content of the component before DialogWindow* dw.

If anyone have a better way to do it, it was good to know.

What could be the solution to load the component but with dinamic memory allocation ?

Or should i use a diferent type of window ?



Is this a duplicate question?


This is considered cross-posting and is poor forum etiquette. Please post your question in a single thread. Cross-posting is often considered spamming, and you could get banned.

Hi Matty,

far from my idea or dreams to put the same question twice. Even before i put the question i search over and over the forum for a answer to my problems and do many test on some solutions in similar problems.

The situation i am asking for help even its related with DialogWindow that i already had questioned about the close button on the component, it's related with the component itself that uses a connection to a dabatase, and when it does it, it give me memory allocation error.

I believed that, since this is a new situation, that i needed to ask for help in another post.

And i posted the code i am using to call this component, because perahps the problem was on the way i was doing it..

Sorry if i thinked on wrong way.


You posted the same section of code THREE times:




In this case, you should probably just have combined all of your questions into one post. It's fine to ask a few different questions in one post if you are asking about the same topic--and all three of these posts are asking about DialogWindow.

It has nothing to do with your intentions, which I'm sure were good! People are much more likely to help you out if you are polite and follow good forum etiquette.