From c043fe3c5a5dca44d3591eea262a791a9adbec06 Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Tue, 8 May 2012 12:48:24 +0200 Subject: [PATCH] client local game crash fix --- cockatrice/src/playertarget.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cockatrice/src/playertarget.cpp b/cockatrice/src/playertarget.cpp index 37d8e1be..6e21fa65 100644 --- a/cockatrice/src/playertarget.cpp +++ b/cockatrice/src/playertarget.cpp @@ -138,9 +138,11 @@ void PlayerTarget::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*o AbstractCounter *PlayerTarget::addCounter(int _counterId, const QString &_name, int _value) { - if (playerCounter) - return 0; - + if (playerCounter) { + disconnect(playerCounter, 0, this, 0); + playerCounter->delCounter(); + } + 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(counterDeleted()));