diff options
-rw-r--r-- | src/mir_core/src/CCtrlPages.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mir_core/src/CCtrlPages.cpp b/src/mir_core/src/CCtrlPages.cpp index 1d2d08694d..86011961fb 100644 --- a/src/mir_core/src/CCtrlPages.cpp +++ b/src/mir_core/src/CCtrlPages.cpp @@ -373,8 +373,9 @@ void CCtrlPages::OnDestroy() int tabCount = GetCount(); for (int i = 0; i < tabCount; i++) { TPageInfo *p = GetItemPage(i); - if (p->m_pDlg->GetHwnd()) - p->m_pDlg->Close(); + CDlgBase *pDlg = p->m_pDlg; p->m_pDlg = nullptr; + if (pDlg->GetHwnd()) + pDlg->Close(); delete p; } |