App crashing on exit in release mode not in debug
My application is crashing when it executes in release mode but does fine in debug. I am using a thread for reading the serial port, but in AppExit I check for and kill the thread if it exists. What else would cause this? Is there any way to figure out where this is occurring by debugging the running release mode application?
Thanks,
Steve
Re: App crashing on exit in release mode not in debug
After further testing, it turns out to be a call to GetWindowPlacement(). The code is as follows:
CAWIMSApp* pApp = (CAWIMSApp*)AfxGetApp();
WINDOWPLACEMENT *wndpl;
pApp->m_pMainWnd->GetWindowPlacement(wndpl);
AfxMessageBox("Finished GetWindowPlacement");
pApp->WriteProfileInt("AWIMS Client","Maximized",pApp->m_pMainWnd->IsZoomed());
pApp->WriteProfileInt("AWIMS Client","Minimized",pApp->m_pMainWnd->IsIconic());
pApp->WriteProfileInt("AWIMS Client","Left",wndpl->rcNormalPosition.left);
pApp->WriteProfileInt("AWIMS Client","Right",wndpl->rcNormalPosition.right);
pApp->WriteProfileInt("AWIMS Client","Top",wndpl->rcNormalPosition.top);
pApp->WriteProfileInt("AWIMS Client","Bottom",wndpl->rcNormalPosition.bottom);
Re: App crashing on exit in release mode not in debug
Ok, I was reading my post looking at my code snippet, I noticed that I did not allocated memory for the wndpl variable. Oops! Nevermind!!!!
Re: App crashing on exit in release mode not in debug
Ok, now that I fixed that problem, I am still have the original crash. This time it occurs when I call exit(0); Any ideas?
Re: App crashing on exit in release mode not in debug
Don't acll exit(0) from a windows app