mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
Qt 4.8 crash fix
This commit is contained in:
parent
c7fa2fe985
commit
61f5cd478d
3 changed files with 13 additions and 7 deletions
|
|
@ -56,6 +56,13 @@ PlayerTarget::PlayerTarget(Player *_owner, QGraphicsItem *parentItem)
|
|||
fullPixmap = QPixmap();
|
||||
}
|
||||
|
||||
PlayerTarget::~PlayerTarget()
|
||||
{
|
||||
// Explicit deletion is necessary in spite of parent/child relationship
|
||||
// as we need this object to be alive to receive the destroyed() signal.
|
||||
delete playerCounter;
|
||||
}
|
||||
|
||||
QRectF PlayerTarget::boundingRect() const
|
||||
{
|
||||
return QRectF(0, 0, 160, 64);
|
||||
|
|
@ -136,12 +143,12 @@ AbstractCounter *PlayerTarget::addCounter(int _counterId, const QString &_name,
|
|||
|
||||
playerCounter = new PlayerCounter(owner, _counterId, _name, _value, this);
|
||||
playerCounter->setPos(boundingRect().width() - playerCounter->boundingRect().width(), boundingRect().height() - playerCounter->boundingRect().height());
|
||||
connect(playerCounter, SIGNAL(destroyed()), this, SLOT(delCounter()));
|
||||
connect(playerCounter, SIGNAL(destroyed()), this, SLOT(counterDeleted()));
|
||||
|
||||
return playerCounter;
|
||||
}
|
||||
|
||||
void PlayerTarget::delCounter()
|
||||
void PlayerTarget::counterDeleted()
|
||||
{
|
||||
playerCounter = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue