Dear Support,
We’ve been having sporadic crashes in this function when loading UI states for a long time, and we think that we understand the reason, but we still need your help to realy understand what is happening.
This is the location of the crash in the function CExtCmdProfile::SerializeState
, lines 1860 onwards:
...
for( ; true; )
{
UINT nCmdId, nUsageTickCount;
ar >> dwTmp;
nCmdId = UINT(dwTmp);
if( nCmdId == 0 )
break;
ar >> dwTmp;
nUsageTickCount = UINT(dwTmp);
CExtCmdItem * pCmdItem = CmdGetPtr(nCmdId);
...
What we see is that the function
CmdGetPtr
returns NULL.
We see that this happens when the application was running and the user selected a command from a popup menu, this command, for some reason was saved in the serialized data, and the next time we load the application, it crashes.
We updated the function to skip these commands:
if (NULL==pCmdItem)
{
continue;
}
And everything seems to run file now.
Can you please explain why this happens?
Thanks,
Ron.