mirror of https://github.com/odrling/Aegisub
Fix a crash when reattaching video
The window close event propagates up to the detached window's parent, so the handler for the parent window closing needs to filter it out.
This commit is contained in:
parent
0b2d0d40d5
commit
9b815ac8cc
|
@ -369,7 +369,12 @@ int AegisubApp::OnExit() {
|
|||
|
||||
agi::Context& AegisubApp::NewProjectContext() {
|
||||
auto frame = new FrameMain;
|
||||
frame->Bind(wxEVT_DESTROY, [=](wxWindowDestroyEvent&) {
|
||||
frame->Bind(wxEVT_DESTROY, [=](wxWindowDestroyEvent& evt) {
|
||||
if (evt.GetWindow() != frame) {
|
||||
evt.Skip();
|
||||
return;
|
||||
}
|
||||
|
||||
frames.erase(remove(begin(frames), end(frames), frame), end(frames));
|
||||
if (frames.empty()) {
|
||||
ExitMainLoop();
|
||||
|
|
Loading…
Reference in New Issue