Hi,
I have a class called CMyClass. My application has list of CMyClass object. Module2 is used to create and delete the CMyClass object and append to the Qlist which is in Module1.
The declaration of the QList as follows:
QList<CMyClass *>* listObject = new QList<CMyClass *>();
Initially if i am appending the CMyClass object listObject works fine. if I remove last item from the listObject and try to append one more CMyClass object, then following error occures:
QList: out of memory
This error only occures only if I delete one item from list and try to append one more.
When i debug the program it was crashing in following code(red color):
Q_OUTOFLINE_TEMPLATE void QList<T>::detach_helper()
{
Node *n = reinterpret_cast<Node *>(p.begin());
QListData:ata *x = p.detach2();
node_copy(reinterpret_cast<Node *>(p.begin()), reinterpret_cast<Node *>(p.end()), n);
if (!x->ref.deref())
free(x);
}
Following are the Call stack:
QtCored4.dll!qt_message_output(QtMsgType msgType=QtFatalMsg, const char * buf=0x001298d4) Line 2032 C++
QtCored4.dll!qFatal(const char * msg=0x6723a96c, ...) Line 2238 + 0xe bytes C++
QtCored4.dll!QListData::detach2() Line 76 + 0xa bytes C++
MainAppd.dll!QList<MyListholdingClass *>::detach_helper() Line 500 + 0x9 bytes C++
MainAppd.dll!QList<MyListholdingClass *>::detach() Line 99 + 0x23 bytes C++
MainAppd.dll!QList<MyListholdingClass *>::append(MyListholdingClass * const & t=0x0432fd50) Line 401 C++
Can anyone please tell me how can i resolve this.
Bookmarks