Hi,
strId is set to "1911" for testing purposes, but sometimes it is a bad ptr and I don't know why?
Possible because this function gets called from another thread, well I say that, the other thread emits a signal which causes this code to be called, the other thread does pass across a pointer to the following data structure :
struct MESSAGEDATA
{
};
struct MESSAGEDATA
{
QString strId;
QString strData;
};
To copy to clipboard, switch view to plain text mode
Thread just does :
MESSAGEDATA can[MAX];
can[0].strId = "1911";
can[0].strData = "0F0F0F0F0F0F";
emit modifytable( &can[0] );
MESSAGEDATA can[MAX];
can[0].strId = "1911";
can[0].strData = "0F0F0F0F0F0F";
emit modifytable( &can[0] );
To copy to clipboard, switch view to plain text mode
Quite possible I've answered my own question, it could be the fact that passing a pointer to this structure is not safe?
And the modifytable slot function is :
void CanTree::updatetable( MESSAGEDATA* pData )
{
m_pModel->updateTable( pData->strData, pData->strId );
}
void CanTree::updatetable( MESSAGEDATA* pData )
{
m_pModel->updateTable( pData->strData, pData->strId );
}
To copy to clipboard, switch view to plain text mode
Which updates the model with the relevant data.
Regards,
Steve
Bookmarks