summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThanos Doukoudakis <thanos.doukoudakis@isode.com>2018-02-23 13:42:33 (GMT)
committerTobias Markmann <tm@ayena.de>2018-02-27 12:40:51 (GMT)
commit5f29e9c18994da9812dd21a60b5ed4edf3dc48fd (patch)
tree36228b31de3c55d3a6e428dec6a2ef3cb8e90e55
parent8ede4f21d6b81263b15487509e37e6df4553c18f (diff)
downloadswift-5f29e9c18994da9812dd21a60b5ed4edf3dc48fd.zip
swift-5f29e9c18994da9812dd21a60b5ed4edf3dc48fd.tar.bz2
Fix a crash that occurs with closed chat tabs after resizing trellis
This patch address an issue where, after resizing trellis in a smaller grid size, all closed tabs widgets (ChatWindows, Debug Console etc) that were in a grid cell that got removed, were being destroyed leading to some crashes whenever the widget was used again. Test-Information: Tested the changes in windows with Qt 5.8 and Ubuntu 17.10 with Qt 5.9.1. Tested the client behaviour when opening, closing and re-opening multiple tabs (chat windows, debug console, File transfer overview), before and after resizing the trellis. Change-Id: I923299fe90aa39737d6a3e0ace107018f126880e
-rw-r--r--Swift/QtUI/Trellis/QtDynamicGridLayout.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Swift/QtUI/Trellis/QtDynamicGridLayout.cpp b/Swift/QtUI/Trellis/QtDynamicGridLayout.cpp
index b753ffa..2509b3f 100644
--- a/Swift/QtUI/Trellis/QtDynamicGridLayout.cpp
+++ b/Swift/QtUI/Trellis/QtDynamicGridLayout.cpp
@@ -144,7 +144,9 @@ void QtDynamicGridLayout::removeTab(int index) {
int tabIndex = -1;
QtTabWidget* tabWidget = indexToTabWidget(index, tabIndex);
if (tabWidget) {
+ QWidget* tab = tabWidget->widget(tabIndex);
tabWidget->removeTab(tabIndex);
+ tab->setParent(nullptr);
}
}