FIX: program exit crash of MediaFilePanel

Change-Id: I1f5dcdc461e2a551a2980bc76e585c34d68a541f
This commit is contained in:
chunmao.guo 2023-07-03 20:13:06 +08:00 committed by Lane.Wei
parent 2565a66b6d
commit 0edb4476cf
1 changed files with 2 additions and 1 deletions

View File

@ -182,7 +182,8 @@ MediaFilePanel::MediaFilePanel(wxWindow * parent)
auto onShowHide = [this](auto &e) {
e.Skip();
if (m_isBeingDeleted) return;
if (auto w = dynamic_cast<wxWindow *>(e.GetEventObject()); !w || w->IsBeingDeleted())
return;
CallAfter([this] {
auto fs = m_image_grid ? m_image_grid->GetFileSystem() : nullptr;
if (fs) IsShownOnScreen() ? fs->Start() : fs->Stop();