githubuser0xFFFF / Qt-Advanced-Docking-System

Advanced Docking System for Qt
GNU Lesser General Public License v2.1
1.87k stars 548 forks source link

Crashing often due to QTimer in updateTabs #639

Closed ensisoft closed 5 months ago

ensisoft commented 5 months ago

Hello,

I'm wondering if I'm doing something wrong, but I'm seeing a lot of crashes typically when trying to close and delete an ADS widget.

Essentially there's this code in DockAreaTabBarPrivate::updateTabs that uses a timer to work around some issue. However I find that this function is called when a tab is deleted when the timer runs the pointer is garbage and a crash happens.

I just wonder whether this is a known issue or whether I'm doing something wrong?

https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/blob/master/src/DockAreaTabBar.cpp#L116

Thanks!

invisibleGG commented 5 months ago

QTimer::singleShot(0, TabWidget, [&, TabWidget] change to QTimer::singleShot(0, _this, [&, TabWidget]