I think I have found out in the source where this is coming from.
I have a function called autoSelected with the following code:
void CBrowserDoc::autoSelectFiles()
{
//Select each entry in the file table view
m_pbrowserView->getFileTableView()->selectAll();
//If this browser document has no file selection model yet, create a raw data profile and a file selection model and activate it
if(m_selectionTableModels.isEmpty())
{
if(!m_rawDataProfile)
{
m_rawDataProfile = new CRawDataProfile(this);
}
CFileSelectionModel* fileSelectionModel = new CFileSelectionModel(this);
fileSelectionModel->setActive(true);
fileSelectionModel->setLinkedToBrowser(true);
m_rawDataProfile->addSelectionModel(fileSelectionModel);
}
emit toConsole
(QString("The following files were automatically added to selection ").
append(QString::number(getActiveSelection
()->getId
())),STANDARD
);
//Get the indexes of the file table entries that are selected and then clear the selection
QModelIndexList indexes = m_pbrowserView->getSelectedInFileTable();
qSort(indexes);
m_pbrowserView->getFileTableView()->clearSelection();
CTableModel* tableModel = (CTableModel*)m_fileTableModel->sourceModel();
if(!getActiveSelection()) return;
CFileSelectionModel* activeSelection = getActiveSelection();
CFileTableEntry* temp;
int row = -1;
for(int i=0;i<indexes.size();i++)
{
if(row != (index = indexes.value(i)).row())
{
row = index.row();
if (temp = tableModel->getTableEntry(index))
{
//if the entry passes the filter options add the entry to the active file selection model
//and add its coordinates to the raw data profile
if(tableModel->getFilterOptions()->passesFilter(temp))
{
emit toConsole(temp->getFileName(),STANDARD);
activeSelection->addEntry(temp);
int selectionModelIndex = m_rawDataProfile->getSelectionModelIndex(activeSelection);
CPlotData* plotData = m_rawDataProfile->getPlotData(selectionModelIndex);
double x = temp->getX();
double RsqAll = temp->getRsqAll();
plotData->addPoint(x,RsqAll);
}
}
}
}
} // If I put a breakpoint here running in release: It still works. After it fails.
void CBrowserDoc::autoSelectFiles()
{
//Select each entry in the file table view
m_pbrowserView->getFileTableView()->selectAll();
//If this browser document has no file selection model yet, create a raw data profile and a file selection model and activate it
if(m_selectionTableModels.isEmpty())
{
if(!m_rawDataProfile)
{
m_rawDataProfile = new CRawDataProfile(this);
}
CFileSelectionModel* fileSelectionModel = new CFileSelectionModel(this);
fileSelectionModel->setActive(true);
fileSelectionModel->setLinkedToBrowser(true);
m_rawDataProfile->addSelectionModel(fileSelectionModel);
}
emit toConsole(QString("The following files were automatically added to selection ").append(QString::number(getActiveSelection()->getId())),STANDARD);
//Get the indexes of the file table entries that are selected and then clear the selection
QModelIndexList indexes = m_pbrowserView->getSelectedInFileTable();
qSort(indexes);
m_pbrowserView->getFileTableView()->clearSelection();
CTableModel* tableModel = (CTableModel*)m_fileTableModel->sourceModel();
if(!getActiveSelection()) return;
CFileSelectionModel* activeSelection = getActiveSelection();
CFileTableEntry* temp;
int row = -1;
for(int i=0;i<indexes.size();i++)
{
QModelIndex index;
if(row != (index = indexes.value(i)).row())
{
row = index.row();
if (temp = tableModel->getTableEntry(index))
{
//if the entry passes the filter options add the entry to the active file selection model
//and add its coordinates to the raw data profile
if(tableModel->getFilterOptions()->passesFilter(temp))
{
emit toConsole(temp->getFileName(),STANDARD);
activeSelection->addEntry(temp);
int selectionModelIndex = m_rawDataProfile->getSelectionModelIndex(activeSelection);
CPlotData* plotData = m_rawDataProfile->getPlotData(selectionModelIndex);
double x = temp->getX();
double RsqAll = temp->getRsqAll();
plotData->addPoint(x,RsqAll);
}
}
}
}
} // If I put a breakpoint here running in release: It still works. After it fails.
To copy to clipboard, switch view to plain text mode
So what i think is happing at the moment the program leaves this code, it will destroy the object/variables inside it. So I persume something will go wrong when it tries to delete QModelIndexList indexes.
The output window gives the following:
'Tivoli.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.windows.gdiplus_6 595b64144ccf1df_1.1.7601.17825_none_72d273598668a0 6b\GdiPlus.dll'
First-chance exception at 0x7578b9bc in Tivoli.exe: Microsoft C++ exception: CExcept at memory location 0x0062c640..
Tivoli.exe has triggered a breakpoint
I have some more information from the call stack:
> msvcr90d.dll!operator delete(void * pUserData=0x24cccff0) Line 52 + 0x51 bytes C++
Tivoli.exe!QModelIndex::`scalar deleting destructor'() + 0x21 bytes C++
Tivoli.exe!QList<QModelIndex>::node_destruct(QList <QModelIndex>::Node * from=0x24c60e14, QList<QModelIndex>::Node * to=0x24c60fd8) Line 418 + 0x2f bytes C++
Tivoli.exe!QList<QModelIndex>::free(QListData:ata * data=0x24c60e00) Line 744 C++
Tivoli.exe!QList<QModelIndex>::~QList<QModelIndex> () Line 718 C++
Tivoli.exe!CBrowserDoc::autoSelectFiles() Line 487 + 0xf bytes C++
Tivoli.exe!CMainFrame:nAutoSelect() Line 2394 C++
So I believe, like d_stranz set, at this point, there all ready is a problem. Any clues? The destructor that has been called by the program happens after the entire function has been called...
Optimization turned off, same result. Clean solution and rebuilding: same result..
From debug to release can be a pain the ass!
Bookmarks