From 73aae9a61063598aba19c22b45da4340c030b93c Mon Sep 17 00:00:00 2001 From: Rishabh Soni Date: Fri, 29 Jan 2021 01:45:42 +0530 Subject: [PATCH] Fixed bug : Crash on closing empty tab after Settings opened. (#577) Just one little change was needed, the setSelectionBehaviorOnRemove() function was to be executed before comparing the index with m_settingsIndex. --- src/tabbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tabbar.cpp b/src/tabbar.cpp index da0ccfa..68e9bb1 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -177,6 +177,7 @@ void TabBar::triggerWebPageAction(QWebEnginePage::WebAction action, ZimView *wid void TabBar::closeTab(int index) { + setSelectionBehaviorOnRemove(index); if (index == 0 || index == this->count() - 1) return; if (index == m_settingsIndex) { @@ -185,7 +186,6 @@ void TabBar::closeTab(int index) if (index < m_settingsIndex) { m_settingsIndex--; } - setSelectionBehaviorOnRemove(index); auto webview = widget(index); mp_stackedWidget->removeWidget(webview); webview->setParent(nullptr);