ZHawk
3rd January 2011, 12:03
Hi,
i have Qt 4.7.1 and VS2010 Express
the following code crashes with no reason:
#include "QApplication"
#include <QtCore>
void test( )
{
QVariant v, v2;
QList<QVariant> list;
v.setValue(1); // init variant with integer = 1
list.append(v); // add variant to list
v2.setValue(list); // add list to variant
qDebug() << v;
qDebug() << list;
qDebug() << v2;
// leaving this function will crash with a corrupted heap
// output see below
}
int main( int argc , char *argv[] )
{
test();
QApplication app(argc, argv);
return app.exec();
}
my output:
QVariant(int, 1)
(QVariant(int, 1) )
QVariant(QVariantList, (QVariant(int, 1) ) )
after the crash it points me to "qguivariant.cpp" line 280:
qcoreVariantHandler()->clear(d);
any help ?
thanks
i have Qt 4.7.1 and VS2010 Express
the following code crashes with no reason:
#include "QApplication"
#include <QtCore>
void test( )
{
QVariant v, v2;
QList<QVariant> list;
v.setValue(1); // init variant with integer = 1
list.append(v); // add variant to list
v2.setValue(list); // add list to variant
qDebug() << v;
qDebug() << list;
qDebug() << v2;
// leaving this function will crash with a corrupted heap
// output see below
}
int main( int argc , char *argv[] )
{
test();
QApplication app(argc, argv);
return app.exec();
}
my output:
QVariant(int, 1)
(QVariant(int, 1) )
QVariant(QVariantList, (QVariant(int, 1) ) )
after the crash it points me to "qguivariant.cpp" line 280:
qcoreVariantHandler()->clear(d);
any help ?
thanks