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)
This commit is contained in:
invisibleGG 2024-06-03 14:29:59 +08:00 committed by GitHub
parent 3ff6918b1f
commit 06e8451fc0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -111,7 +111,7 @@ void DockAreaTabBarPrivate::updateTabs()
// Sometimes the synchronous calculation of the rectangular area fails // Sometimes the synchronous calculation of the rectangular area fails
// Therefore we use QTimer::singleShot here to execute the call // Therefore we use QTimer::singleShot here to execute the call
// within the event loop - see #520 // within the event loop - see #520
QTimer::singleShot(0, TabWidget, [&, TabWidget] QTimer::singleShot(0, _this, [&, TabWidget]
{ {
_this->ensureWidgetVisible(TabWidget); _this->ensureWidgetVisible(TabWidget);
}); });