| 322 | } |
| 323 | |
| 324 | int CFamiTrackerApp::ExitInstance() |
| 325 | { |
| 326 | // Close program |
| 327 | // The document is already closed at this point (and detached from sound player) |
| 328 | |
| 329 | TRACE(L"App: Begin ExitInstance\n"); |
| 330 | |
| 331 | UnregisterSingleInstance(); |
| 332 | |
| 333 | ShutDownSynth(); |
| 334 | |
| 335 | if (m_pMIDI) { |
| 336 | m_pMIDI->Shutdown(); |
| 337 | m_pMIDI.reset(); |
| 338 | } |
| 339 | |
| 340 | if (m_pAccel) { |
| 341 | m_pAccel->SaveShortcuts(GetSettings()); |
| 342 | m_pAccel->Shutdown(); |
| 343 | m_pAccel.reset(); |
| 344 | } |
| 345 | |
| 346 | if (m_pSettingsService) { |
| 347 | m_pSettingsService->SaveSettings(); |
| 348 | m_pSettingsService.reset(); |
| 349 | } |
| 350 | |
| 351 | #ifdef SUPPORT_TRANSLATIONS |
| 352 | if (m_hInstResDLL) { |
| 353 | // Revert back to internal resources |
| 354 | AfxSetResourceHandle(m_hInstance); |
| 355 | // Unload DLL |
| 356 | ::FreeLibrary(m_hInstResDLL); |
| 357 | m_hInstResDLL = NULL; |
| 358 | } |
| 359 | #endif |
| 360 | |
| 361 | m_pVersionChecker.reset(); // // // |
| 362 | |
| 363 | TRACE(L"App: End ExitInstance\n"); |
| 364 | |
| 365 | return CWinApp::ExitInstance(); |
| 366 | } |
| 367 | |
| 368 | BOOL CFamiTrackerApp::PreTranslateMessage(MSG* pMsg) |
| 369 | { |
nothing calls this directly
no test coverage detected