From 27f62a8755fbbfd1a0bb100f12d566e7d85ef2bf Mon Sep 17 00:00:00 2001 From: lahm86 <33758420+lahm86@users.noreply.github.com> Date: Sat, 5 Oct 2024 19:57:58 +0100 Subject: [PATCH] tr1/photo_mode: fix freeing the UI This ensures text with the manual_draw flag is included in decrementing the overall text count, and fixes freeing the photo mode UI components themselves. Resolves #1680. --- src/tr1/game/text.c | 2 +- src/tr1/game/ui/widgets/photo_mode.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/tr1/game/text.c b/src/tr1/game/text.c index f7b89ce38..3f25cf4d9 100644 --- a/src/tr1/game/text.c +++ b/src/tr1/game/text.c @@ -467,7 +467,7 @@ void Text_Remove(TEXTSTRING *const text) if (text == NULL) { return; } - if (text->flags.active) { + if (text->flags.active || text->flags.manual_draw) { text->flags.active = 0; m_TextCount--; } diff --git a/src/tr1/game/ui/widgets/photo_mode.c b/src/tr1/game/ui/widgets/photo_mode.c index 4c01fe47f..3fcf490ca 100644 --- a/src/tr1/game/ui/widgets/photo_mode.c +++ b/src/tr1/game/ui/widgets/photo_mode.c @@ -77,12 +77,12 @@ static void M_Free(UI_PHOTO_MODE *const self) self->right_labels[i]->free(self->right_labels[i]); } self->spacer->free(self->spacer); - self->spacer->free(self->title); - self->spacer->free(self->outer_stack); - self->spacer->free(self->inner_stack); - self->spacer->free(self->left_stack); - self->spacer->free(self->right_stack); - self->spacer->free(self->window); + self->title->free(self->title); + self->outer_stack->free(self->outer_stack); + self->inner_stack->free(self->inner_stack); + self->left_stack->free(self->left_stack); + self->right_stack->free(self->right_stack); + self->window->free(self->window); Memory_Free(self->left_labels); Memory_Free(self->right_labels); Memory_Free(self);