[commit] r1652 - trunk/GME/Gme

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Thu Oct 27 17:50:16 CDT 2011


Author: ksmyth
Date: Thu Oct 27 17:50:16 2011
New Revision: 1652

Log:
Fix crash on double delete when Creating main frame fails (e.g. no IE)

Modified:
   trunk/GME/Gme/GMEApp.cpp

Modified: trunk/GME/Gme/GMEApp.cpp
==============================================================================
--- trunk/GME/Gme/GMEApp.cpp	Thu Oct 27 17:50:04 2011	(r1651)
+++ trunk/GME/Gme/GMEApp.cpp	Thu Oct 27 17:50:16 2011	(r1652)
@@ -361,9 +361,10 @@
 
 	// create main MDI Frame window
 	CMainFrame* pMainFrame = new CMainFrame;
-	if (!pMainFrame || !pMainFrame->LoadFrame(IDR_MAINFRAME))
+	if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
 	{
-		delete pMainFrame;
+		// n.b. if LoadFrame fails, CFrameWnd::PostNcDestroy is called which does `delete this`
+		// delete pMainFrame;
 		return FALSE;
 	}
 	m_pMainWnd = pMainFrame;


More information about the gme-commit mailing list