[commit] r1549 - trunk/GME/Gme
GMESRC Repository Notifications
gme-commit at list.isis.vanderbilt.edu
Tue Sep 20 09:51:11 CDT 2011
Author: ksmyth
Date: Tue Sep 20 09:51:11 2011
New Revision: 1549
Log:
Fix out-of-proc GMEOLEApp access (especially for Udm, GReAT installers)
Modified:
trunk/GME/Gme/GMEApp.cpp
trunk/GME/Gme/GMEOLEApp.cpp
trunk/GME/Gme/MainFrm.cpp
Modified: trunk/GME/Gme/GMEApp.cpp
==============================================================================
--- trunk/GME/Gme/GMEApp.cpp Tue Sep 20 09:50:59 2011 (r1548)
+++ trunk/GME/Gme/GMEApp.cpp Tue Sep 20 09:51:11 2011 (r1549)
@@ -1751,6 +1751,13 @@
{
// Focus must be killed to flush ObjectInspector and Browser
::SetFocus(NULL);
+#ifdef _DEBUG
+ if (SaveAllModified())
+ {
+ CWinAppEx::OnAppExit();
+ return;
+ }
+#else
if (SaveAllModified())
{
// n.b. C# interpreters may not Release() IGMEOLEApp, which keeps us ::Run()ing forever
@@ -1758,6 +1765,7 @@
TerminateProcess(GetCurrentProcess(), 0);
}
// n.b. don't call CWinAppEx::OnAppExit
+#endif
}
BOOL CGMEApp::SaveAllModified()
Modified: trunk/GME/Gme/GMEOLEApp.cpp
==============================================================================
--- trunk/GME/Gme/GMEOLEApp.cpp Tue Sep 20 09:50:59 2011 (r1548)
+++ trunk/GME/Gme/GMEOLEApp.cpp Tue Sep 20 09:51:11 2011 (r1549)
@@ -767,7 +767,10 @@
void CGMEOLEApp::Exit()
{
- theApp.exit();
+ theApp.CloseProject(false);
+ // n.b. Post here, since this call could be out-of-proc, and it won't succeed
+ // if TerminateProcess is called
+ CMainFrame::theInstance->PostMessage(WM_CLOSE, 0, 0);
}
long CGMEOLEApp::RefreshLib( LPCTSTR pLibName, BOOL pUngroup)
Modified: trunk/GME/Gme/MainFrm.cpp
==============================================================================
--- trunk/GME/Gme/MainFrm.cpp Tue Sep 20 09:50:59 2011 (r1548)
+++ trunk/GME/Gme/MainFrm.cpp Tue Sep 20 09:51:11 2011 (r1549)
@@ -225,8 +225,11 @@
void CMainFrame::OnClose()
{
#ifdef _DEBUG
- clearGmeOleApp();
- CMDIFrameWndEx::OnClose();
+ if (theApp.SaveAllModified())
+ {
+ clearGmeOleApp();
+ CMDIFrameWndEx::OnClose();
+ }
#else
theApp.OnAppExit();
#endif
More information about the gme-commit
mailing list