We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e2a359b + 5fb9a6f commit 945427aCopy full SHA for 945427a
fred2/mainfrm.cpp
@@ -144,7 +144,17 @@ void CMainFrame::init_tools() {
144
m_new_ship_type_combo_box.SetCurSel(0);
145
}
146
147
-void CMainFrame::OnClose() {
+void CMainFrame::OnClose()
148
+{
149
+ // CFrameWnd::OnClose() doesn't provide a way for the caller to tell that the close has been cancelled,
150
+ // so let's extract that particular logic and do it manually here
151
+ if (!FREDDoc_ptr->SaveModified())
152
+ return;
153
+
154
+ // and now if we *are* closing, prevent the dialog from coming up
155
+ FREDDoc_ptr->SetModifiedFlag(FALSE);
156
157
+ // do the closing stuff
158
theApp.write_ini_file();
159
SaveBarState("Tools state");
160
CFrameWnd::OnClose();
0 commit comments