Hi,

I have a very simple thing implemented.

//Connect statement something like this...

connect( &contextMenu, SIGNAL( aboutToShow() ), q, SLOT( createContextMenu() ) );


void ClientsGroupsView::createContextMenu()
{
if( selectionModel() == 0 )
return;

const QModelIndexList rows = selectionModel()->selectedRows();

// some other code to show the contents of context menu

}

It is basically a tree view. When the function createContextMenu() returns ( at } ), it is causing crash stating that the crash is due to some heap corruption.

Strangely, If I remove the line which fetches the selectedRows(), the function return does not cause any crash!. I just commented all the lines which make use of "rows" list. It still causes the crash. I do not understand this. I mean, I am not even making use of rows list ( I have to make use of it eventually though), just fetching selectionModel()->selectedRows(); causes the crash at the function return.

Here is the call stack:

ntdll.dll!77f22ea8()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!77f90c9a()
ntdll.dll!77f64bdf()
ntdll.dll!77ef894a()
> QtCored4.dll!QBasicAtomicPointer<QInternal_CallBac kTable>:perator!() Line 127
QtCored4.dll!global_callback_table() Line 2633 + 0x117 bytes C++


Any kind of information will be very helpful.

Thank you,
Ankitha Varsha