From ab2f15a41b59683ecc62d7b35386732c091900e6 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 15 Jun 2018 22:20:12 +0200 Subject: SubWindow: delete views right away when closing tab --- src/mainwindow/widgets/tabwidget.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mainwindow') 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(); } -- cgit v1.2.1