From ba34b60efd32ee1e4ff09073be1ecf57c78b8faa Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Fri, 10 Dec 2010 03:56:08 +0100 Subject: [PATCH] server crash fix --- common/server_protocolhandler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/server_protocolhandler.cpp b/common/server_protocolhandler.cpp index 18c80565..8af18ccb 100644 --- a/common/server_protocolhandler.cpp +++ b/common/server_protocolhandler.cpp @@ -594,7 +594,9 @@ ResponseCode Server_ProtocolHandler::moveCard(Server_Game *game, Server_Player * if (card->getParentCard()) card->setParentCard(0); - const QList &attachedCards = card->getAttachedCards(); + // DO NOT save a reference to the list, but make a real copy. + // The contents of the original list change during the loop. + const QList attachedCards = card->getAttachedCards(); for (int i = 0; i < attachedCards.size(); ++i) unattachCard(game, attachedCards[i]->getZone()->getPlayer(), cont, attachedCards[i]);