summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/stdmsg/src/tabs.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp
index 863c70e67e..1e240e1f44 100644
--- a/src/core/stdmsg/src/tabs.cpp
+++ b/src/core/stdmsg/src/tabs.cpp
@@ -639,13 +639,14 @@ INT_PTR CTabbedWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
break;
case ID_CLOSEOTHER:
- int tabCount = m_tab.GetCount() - 1;
- if (tabCount > 0) {
- for (tabCount; tabCount >= 0; tabCount--) {
+ int tabCount = m_tab.GetCount();
+ if (tabCount > 1) {
+ while (tabCount--) {
if (tabCount == i)
continue;
- m_tab.RemovePage(tabCount);
+ if (pDlg = (CMsgDialog*)m_tab.GetNthPage(tabCount))
+ pDlg->CloseTab();
}
m_tab.ActivatePage(0);
}