From 06e8451fc0fc9079b6c4acf58d02d8f044a3cd53 Mon Sep 17 00:00:00 2001 From: invisibleGG Date: Mon, 3 Jun 2024 14:29:59 +0800 Subject: [PATCH] Update DockAreaTabBar.cpp (#640) This fix seems to have introduced a regression when _this is deleted before the lambda slot occurred, for example deleting the DockManager (and consequently _this) immediately after the execution of updateTabs function (we encountered this problem in linux) --- src/DockAreaTabBar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DockAreaTabBar.cpp b/src/DockAreaTabBar.cpp index 437fe6d..e835144 100644 --- a/src/DockAreaTabBar.cpp +++ b/src/DockAreaTabBar.cpp @@ -111,7 +111,7 @@ void DockAreaTabBarPrivate::updateTabs() // Sometimes the synchronous calculation of the rectangular area fails // Therefore we use QTimer::singleShot here to execute the call // within the event loop - see #520 - QTimer::singleShot(0, TabWidget, [&, TabWidget] + QTimer::singleShot(0, _this, [&, TabWidget] { _this->ensureWidgetVisible(TabWidget); });