Skip to content

Commit

Permalink
tr1/photo_mode: fix freeing the UI
Browse files Browse the repository at this point in the history
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 LostArtefacts#1680.
  • Loading branch information
lahm86 committed Oct 5, 2024
1 parent a6561f1 commit 27f62a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/tr1/game/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -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--;
}
Expand Down
12 changes: 6 additions & 6 deletions src/tr1/game/ui/widgets/photo_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 27f62a8

Please sign in to comment.