[Qt-interest] Segfault when appending to QList

Vedran Furač vedran.furac at gmail.com
Mon Mar 22 02:33:23 CET 2010


Hi,

I'm probably missing something obvious, anyways here's the (simplified)
code:

QList<QPair <int, int> >* foo;

// Passing it to Bar's constructor:

Bar(foo); // Bar inherits QThread.

Bar::Bar(QList<QPair <int, int> >* foo)
    : foo(foo) // Foo* foo; in private: in .h

{   QPair<int, int> bla;
    foo->append(bla);  }

This results with:

Program received signal SIGSEGV, Segmentation fault.
0x0000000000403c8b in QBasicAtomicInt::operator!= (this=0x1f, value=1)
at /usr/include/qt4/QtCore/qbasicatomic.h:75
75              return _q_value != value;

#0  0x0000000000403c8b in QBasicAtomicInt::operator!= (this=0x1f,
value=1) at /usr/include/qt4/QtCore/qbasicatomic.h:75
#1  0x0000000000405d08 in QList<QPair<int, int> >::detach
(this=0x60b700) at /usr/include/qt4/QtCore/qlist.h:122
#2  0x0000000000405c81 in QList<QPair<int, int> >::append
(this=0x60b700, t=...) at /usr/include/qt4/QtCore/qlist.h:468
foo->append(bla); line

TIA!

Regards,
Vedran

-- 
http://vedranf.net | a8e7a7783ca0d460fee090cc584adc12



More information about the Qt-interest-old mailing list