diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mainwindow/widgets/tabwidget.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mainwindow/widgets/tabwidget.cpp b/src/mainwindow/widgets/tabwidget.cpp index 4bc57ce..22e3f9a 100644 --- a/src/mainwindow/widgets/tabwidget.cpp +++ b/src/mainwindow/widgets/tabwidget.cpp @@ -89,10 +89,11 @@ int TabWidget::addTab(WebView *view) void TabWidget::deleteTab(int index) { // deleting the widget automatically removes the tab? - if(count() > 1) { - widget(index)->deleteLater(); - removeTab(index); - } else + auto *w = widget(index); + disconnect(w); + delete w; + + if(count() == 0) parentWidget()->close(); } |