Everything was usual: clicked Disconnect, then clicked X system button at the top right corner, answered Yes, and in a short while got an offer to create a crash dump.
The crash dump points at the line 230 in MuleListCtrl.cpp
piArray[iCurrent] = piArray[iCurrent + 1];
in void CMuleListCtrl::ShowColumn(int iColumn)
That function was called from void CMuleListCtrl::SaveSettings()
My guess was that there is no need to call ShowColumn when application is exiting.
For that I made a small change in SaveSettings() - added application state checking.
The method now is like this:
void CMuleListCtrl::SaveSettings() { ASSERT(!m_Name.IsEmpty()); ASSERT(GetHeaderCtrl()->GetItemCount() == m_iColumnsTracked); if (m_Name.IsEmpty() || GetHeaderCtrl()->GetItemCount() != m_iColumnsTracked) return; CIni ini(thePrefs.GetConfigFile(), _T("ListControlSetup")); ShowWindow(SW_HIDE); int* piSortHist = new int[MAX_SORTORDERHISTORY]; int i=0; POSITION pos1, pos2; for (pos1 = m_liSortHistory.GetHeadPosition();( pos2 = pos1 ) != NULL;) { m_liSortHistory.GetNext(pos1); piSortHist[i++]=m_liSortHistory.GetAt(pos2)+1; } ini.SerGet(false, piSortHist, i, m_Name + _T("SortHistory")); // store additional settings ini.WriteInt(m_Name + _T("TableSortItem"), GetSortItem()); ini.WriteInt(m_Name + _T("TableSortAscending"), GetSortType(m_atSortArrow)); if (theApp.m_app_state == APP_STATE_RUNNING) { //+++ only when running int* piColWidths = new int[m_iColumnsTracked]; int* piColHidden = new int[m_iColumnsTracked]; INT *piColOrders = new INT[m_iColumnsTracked]; for(i = 0; i < m_iColumnsTracked; i++) { piColWidths[i] = GetColumnWidth(i); piColHidden[i] = IsColumnHidden(i); ShowColumn(i); } GetHeaderCtrl()->GetOrderArray(piColOrders, m_iColumnsTracked); ini.SerGet(false, piColWidths, m_iColumnsTracked, m_Name + _T("ColumnWidths")); ini.SerGet(false, piColHidden, m_iColumnsTracked, m_Name + _T("ColumnHidden")); ini.SerGet(false, piColOrders, m_iColumnsTracked, m_Name + _T("ColumnOrders")); for(i = 0; i < m_iColumnsTracked; i++) if (piColHidden[i]==1) HideColumn(i); ShowWindow(SW_SHOW); delete[] piColOrders; delete[] piColHidden; delete[] piColWidths; } delete[] piSortHist; }
I will keep watching how the fix works, but so far it was fine.
Probably application wraps up slightly faster now, though I did not try to measure that.
Edit. Unfortunatly, that was too simple: maybe it solves crash problem, but causes reordering of columns in lists. I'll take a closer look at tHeWiZaRdOfDoS's variant.
This post has been edited by fox88: 17 April 2013 - 06:19 AM