mirror of https://github.com/odrling/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
|
@ -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 New Issue