mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-22 11:37:56 -04:00
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.
This commit is contained in:
parent
f91f4b15d9
commit
73aae9a610
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user