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
1 changed files with 6 additions and 1 deletions
|
@ -369,7 +369,12 @@ int AegisubApp::OnExit() {
|
||||||
|
|
||||||
agi::Context& AegisubApp::NewProjectContext() {
|
agi::Context& AegisubApp::NewProjectContext() {
|
||||||
auto frame = new FrameMain;
|
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));
|
frames.erase(remove(begin(frames), end(frames), frame), end(frames));
|
||||||
if (frames.empty()) {
|
if (frames.empty()) {
|
||||||
ExitMainLoop();
|
ExitMainLoop();
|
||||||
|
|
Loading…
Reference in a new issue