aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-06-15 22:20:12 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-06-15 22:20:12 +0200
commitab2f15a41b59683ecc62d7b35386732c091900e6 (patch)
tree622fabde446c3bdf43d327f5a05e54f6b4a3715e /src
parentUpdate building.md (diff)
downloadsmolbote-ab2f15a41b59683ecc62d7b35386732c091900e6.tar.xz
SubWindow: delete views right away when closing tab
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow/widgets/tabwidget.cpp9
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();
}