fix a use after free in the edit player menu

This commit is contained in:
Isaac0-dev 2025-11-24 10:53:44 +10:00
parent 983932214a
commit bd5cf36c61

View file

@ -205,6 +205,7 @@ static void djui_panel_player_edit_palette_destroy(struct DjuiBase* caller) {
}
sColorRect = NULL;
gDjuiPaletteToggle = NULL;
if (sPalettePresetSelection) {
sPalettePresetIndex = djui_panel_player_edit_palette_get_palette_index(configPlayerPalette);
@ -372,7 +373,7 @@ static void djui_panel_player_name_active_palette(struct DjuiBase* caller) {
struct DjuiButton* button2 = djui_button_right_create(&rect3->base, DLANG(PLAYER, SAVE_PRESET), DJUI_BUTTON_STYLE_NORMAL, djui_panel_player_active_palette_export);
djui_base_set_size(&button2->base, 0.485f, 32);
}
{
struct DjuiText *text = djui_text_create(body, DLANG(PLAYER, CAP_TOGGLE));
djui_text_set_alignment(text, DJUI_HALIGN_CENTER, DJUI_VALIGN_TOP);