Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
8fb561b4
Unverified
Commit
8fb561b4
authored
May 09, 2021
by
Zach H
Committed by
GitHub
May 09, 2021
Browse files
Fix regression from #4281 which caused crash with QList and GCC race time (#4341)
parent
b9c4b496
Changes
1
Hide whitespace changes
Inline
Side-by-side
common/server_game.cpp
View file @
8fb561b4
...
...
@@ -575,15 +575,19 @@ void Server_Game::unattachCards(GameEventStorage &ges, Server_Player *player)
{
QMutexLocker
locker
(
&
gameMutex
);
QMapIterator
<
QString
,
Server_CardZone
*>
zoneIterator
(
player
->
getZones
());
for
(
Server_CardZone
*
zone
:
player
->
getZones
())
{
for
(
Server_Card
*
card
:
zone
->
getCards
())
{
for
(
auto
zone
:
player
->
getZones
())
{
for
(
auto
card
:
zone
->
getCards
())
{
if
(
card
==
nullptr
)
{
continue
;
}
const
auto
&
attachedCardsBase
=
card
->
getAttachedCards
();
if
(
attachedCardsBase
.
isEmpty
())
{
continue
;
}
// Make a copy of the list because the original one gets modified during the loop
QList
<
Server_Card
*>
attachedCards
=
card
->
getA
ttachedCards
()
;
QList
<
Server_Card
*>
attachedCards
=
{
a
ttachedCards
Base
}
;
for
(
Server_Card
*
attachedCard
:
attachedCards
)
{
attachedCard
->
getZone
()
->
getPlayer
()
->
unattachCard
(
ges
,
attachedCard
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment