| 316 | } |
| 317 | |
| 318 | int AegisubApp::OnExit() { |
| 319 | for (auto frame : frames) |
| 320 | delete frame; |
| 321 | frames.clear(); |
| 322 | |
| 323 | if (wxTheClipboard->Open()) { |
| 324 | wxTheClipboard->Flush(); |
| 325 | wxTheClipboard->Close(); |
| 326 | } |
| 327 | |
| 328 | delete config::opt; |
| 329 | delete config::mru; |
| 330 | hotkey::clear(); |
| 331 | cmd::clear(); |
| 332 | |
| 333 | delete config::global_scripts; |
| 334 | |
| 335 | AssExportFilterChain::Clear(); |
| 336 | |
| 337 | // Keep this last! |
| 338 | delete agi::log::log; |
| 339 | crash_writer::Cleanup(); |
| 340 | |
| 341 | return wxApp::OnExit(); |
| 342 | } |
| 343 | |
| 344 | agi::Context& AegisubApp::NewProjectContext() { |
| 345 | auto frame = new FrameMain; |