mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-27 00:14:40 -07:00
Fix crash when a replay's board is closed (GameScene teardown abort). The old QObject::disconnect(nullptr, nullptr, this, nullptr) is invalid per Qt docs (the sender must never be nullptr), so it never severed the PMF destroyed -> GameScene::removeAnimatedItem connections that fire when QGraphicsScene::~QGraphicsScene -> clear() destroys the remaining items. Store the QMetaObject::Connection handle for each animated item and disconnect them all in ~GameScene via the connection-handle overload. Dedup connections on the connection map rather than animatedItems, since the animation timer clears animatedItems on completion, which let a re-registered item (e.g. a life counter flashed repeatedly) accumulate orphaned duplicate destroyed connections that survived teardown. |
||
|---|---|---|
| .. | ||
| client | ||
| database/interface | ||
| filters | ||
| game | ||
| game_graphics | ||
| interface | ||
| main.cpp | ||
| main.h | ||
| single_instance_manager.cpp | ||
| single_instance_manager.h | ||