mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 16:32:16 -07:00
In #5447, the `TabSupervisor` logic was changed to go through `closeRequest` instead of `deleteLater`. Unfortunately, this introduced a bug where we close every (most) tabs twice due to `closeRequest` calling `close()`, which is a high-level widget function that triggers a whole lot of events, including `QHideEvent`s, which manifests through #5697. #5735 was a tentative fix for the issue, but it mis-diagnosed the problem and does not actually fix it, as shown by #5740. This patch makes `closeRequest` call `deleteLater` instead, which is a low-level function that doesn't trigger all those events. To make sure slots happening on tab close are still processed, use the `QObject::destroyed` signal instead of the custom `Tab::closed` event. This also fixes what I believe was the missing piece in #5447: `TabSupervisor`'s destructor calling `TabSupervisor::stop`, which in turn sends out a bunch of signals which is never a good idea while in the middle of destruction. Instead, `TabSupervisor`'s destructor now simply deletes its (non-`QObject`) children. I suspect that with `TabSupervisor`'s destructor no longer calling `TabSupervisor::stop` the `closeRequest` API can be simplified again; this is left for later as this PR is focused on fixing the crashes. Supersedes #5735 and #5740. Fixes #5697 (again). |
||
|---|---|---|
| .. | ||
| resources | ||
| sounds | ||
| src | ||
| themes | ||
| translations | ||
| .qdevelop | ||
| CMakeLists.txt | ||
| cockatrice.desktop | ||
| cockatrice.qrc | ||
| cockatrice.rc | ||
| cockatrice_en@source.ts | ||