Cockatrice/cockatrice
Basile Clément 11562ade7a
Avoid double close in TabSupervisor
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).
2025-03-17 17:48:11 +01:00
..
resources Refactor: split card_database into two files (#5715) 2025-03-14 00:02:10 +00:00
sounds Add cmake format (#4618) 2022-05-08 21:22:43 +02:00
src Avoid double close in TabSupervisor 2025-03-17 17:48:11 +01:00
themes Add cmake format (#4618) 2022-05-08 21:22:43 +02:00
translations Translate cockatrice_en@source.ts in pt_BR (#5601) 2025-02-09 22:12:38 +00:00
.qdevelop icon_draw and icon_untap added, icon_general and icon_messages modified 2009-07-31 13:37:16 +02:00
CMakeLists.txt Add CONFIGURE_DEPENDS to the cmake (#5739) 2025-03-17 02:43:11 +00:00
cockatrice.desktop Updated Spanish translation 2011-07-16 11:38:57 +02:00
cockatrice.qrc Generic mana symbols. (#5685) 2025-03-03 13:12:09 -05:00
cockatrice.rc Included uninstaller for Windows version 2010-09-17 15:26:07 +02:00
cockatrice_en@source.ts Update translation source strings (#5571) 2025-02-07 04:59:23 +00:00