Merge pull request #124 from kiwix/close_tab_fix

Keep the mp_stackWidget in sync with the tabBar.
This commit is contained in:
jetownfeve21 2019-04-03 14:17:16 +02:00 committed by GitHub
commit c7f07704e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,10 +34,6 @@ TabBar::TabBar(QWidget *parent) :
return;
}
this->closeTab(index);
auto widget = mp_stackedWidget->widget(index);
mp_stackedWidget->removeWidget(widget);
widget->setParent(nullptr);
delete widget;
});
connect(app->getAction(KiwixApp::ZoomInAction), &QAction::triggered,
this, [=]() {
@ -183,6 +179,8 @@ void TabBar::closeTab(int index)
if (index == 0)
return;
auto webview = widget(index);
mp_stackedWidget->removeWidget(webview);
webview->setParent(nullptr);
removeTab(index);
webview->close();
delete webview;