forked from mia/Aegisub
Fix bad destruction order when exiting without closing the main window first
On OS X, when closing via Quit the document windows are not closed until after OnExit is called, resulting the project context being destructed after the global stuff, resulting in crashes on exit in some cases. Originally committed to SVN as r6812.
This commit is contained in:
parent
7ab4f85211
commit
015d533556
2 changed files with 5 additions and 0 deletions
|
@ -249,6 +249,8 @@ static bool delete_children(wxWindow *window, wxWindow *keep) {
|
|||
}
|
||||
|
||||
FrameMain::~FrameMain () {
|
||||
wxGetApp().frame = 0;
|
||||
|
||||
context->videoController->SetVideo("");
|
||||
context->audioController->CloseAudio();
|
||||
|
||||
|
|
|
@ -292,6 +292,9 @@ bool AegisubApp::OnInit() {
|
|||
/// @return
|
||||
///
|
||||
int AegisubApp::OnExit() {
|
||||
if (frame)
|
||||
delete frame;
|
||||
|
||||
if (wxTheClipboard->Open()) {
|
||||
wxTheClipboard->Flush();
|
||||
wxTheClipboard->Close();
|
||||
|
|
Loading…
Reference in a new issue