Fix HideMapNamePopUpWindow possible overflow

This commit is contained in:
DizzyEggg 2024-02-02 22:31:20 +01:00
parent 5be69b2713
commit e87a69a5e7
2 changed files with 7 additions and 7 deletions

View file

@ -15,11 +15,6 @@ SECTIONS {
ewram 0x2000000 (NOLOAD) :
ALIGN(4)
{
/*
We link malloc.o here to prevent `gHeap` from landing in the middle of EWRAM.
Otherwise this causes corruption issues on some ld versions
*/
gflib/malloc.o(ewram_data);
src/*.o(ewram_data);
gflib/*.o(ewram_data);
} > EWRAM

View file

@ -317,8 +317,13 @@ void HideMapNamePopUpWindow(void)
{
if (FuncIsActiveTask(Task_MapNamePopUpWindow))
{
ClearStdWindowAndFrame(GetMapNamePopUpWindowId(), TRUE);
RemoveMapNamePopUpWindow();
#ifdef UBFIX
if (GetMapNamePopUpWindowId() != WINDOW_NONE)
#endif // UBFIX
{
ClearStdWindowAndFrame(GetMapNamePopUpWindowId(), TRUE);
RemoveMapNamePopUpWindow();
}
SetGpuReg_ForcedBlank(REG_OFFSET_BG0VOFS, 0);
DestroyTask(sPopupTaskId);
}