mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-29 17:32:17 -07:00
Fix use-after-free in CommandZone teardown by disconnecting signals before member destruction
This commit is contained in:
parent
e447542957
commit
e4d50cf731
2 changed files with 8 additions and 0 deletions
|
|
@ -24,6 +24,13 @@ CommandZone::CommandZone(CommandZoneLogic *_logic, int _zoneHeight, QGraphicsIte
|
||||||
setupClipContainer(ZValues::CARD_BASE);
|
setupClipContainer(ZValues::CARD_BASE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CommandZone::~CommandZone()
|
||||||
|
{
|
||||||
|
for (AbstractCounter *ctr : taxCounters) {
|
||||||
|
disconnect(ctr, &QObject::destroyed, this, nullptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CommandZone::updateBg()
|
void CommandZone::updateBg()
|
||||||
{
|
{
|
||||||
update();
|
update();
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@ public:
|
||||||
* @param parent Parent graphics item
|
* @param parent Parent graphics item
|
||||||
*/
|
*/
|
||||||
CommandZone(CommandZoneLogic *_logic, int _zoneHeight, QGraphicsItem *parent);
|
CommandZone(CommandZoneLogic *_logic, int _zoneHeight, QGraphicsItem *parent);
|
||||||
|
~CommandZone() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Handles card drops, calculating insertion position from drop point.
|
* @brief Handles card drops, calculating insertion position from drop point.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue