PDA

View Full Version : QT4 debug mode output / QList: Out of memory



patrik08
25th May 2007, 22:47
I have a xml file setting app.. (portable) and i load this file to..



typedef QMap<QString, QString> Appsetting;

Appsetting OneVar;

QStringList varioarg;
varioarg.clear();
QString variablelist = Global_Config_Base("allname",APPLICATION_SETTING);
varioarg = variablelist.split("|");
QStringListIterator o(varioarg);
while (o.hasNext()) {
QString variablename = o.next();
QString valorsi = Global_Config_Base(variablename,APPLICATION_SETTIN G);
OneVar[variablename] = valorsi;
qDebug() << "### variablename " << variablename << " = " << OneVar[variablename];
}
/* usage from 2 dbs ? */
if (OneVar["usedb2"] == "1") {
usedb2 = true;
} else {
usedb2 = false;
}



can this produce a ....?

QList: Out of memory

30 variable name/value...

on run....


############ Preload go2............. ######
############ Preload go3............. ######
master connect ok
############ Panel building start aa ###### true
############ Panel building start bb ###### true
QList: Out of memory


and app crash..

high_flyer
29th May 2007, 09:53
can this produce a ....?
QList: Out of memory
Yes, if you are using a large amount of data it can, since you are allocating on the stack.
Allocate everything in the section you posted on the heap (and don't forget to clean up).