From d65d5ff40db6f134042bcd56399582999e7e08cf Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 3 Oct 2023 01:35:56 +0300 Subject: [PATCH 52/52] Correctly destroy movement animation's virtual unit See osdn #48788 Signed-off-by: Marko Lindqvist --- client/mapview_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mapview_common.c b/client/mapview_common.c index 7562c91808..029dd5a38f 100644 --- a/client/mapview_common.c +++ b/client/mapview_common.c @@ -196,7 +196,7 @@ void animations_free(void) switch (anim->type) { case ANIM_MOVEMENT: - free(anim->movement.mover); + unit_virtual_destroy(anim->movement.mover); break; case ANIM_BATTLE: unit_virtual_destroy(anim->battle.virt_winner); @@ -272,7 +272,7 @@ static bool movement_animation(struct animation *anim, double time_gone) if (time_gone >= timing_sec) { /* Animation over */ if (--anim->movement.mover->refcount <= 0) { - free(anim->movement.mover); + unit_virtual_destroy(anim->movement.mover); } return TRUE; -- 2.40.1