Use the FREE_AND_SET_NULL macro where appropriate

This commit is contained in:
sphericalice
2022-06-03 15:56:11 +01:00
parent d03756dfd2
commit 284e46927a
6 changed files with 10 additions and 20 deletions

View File

@@ -816,8 +816,7 @@ static void Task_EvolutionScene(u8 taskId)
DestroyTask(taskId);
FreeMonSpritesGfx();
Free(sEvoStructPtr);
sEvoStructPtr = NULL;
FREE_AND_SET_NULL(sEvoStructPtr);
FreeAllWindowBuffers();
SetMainCallback2(gCB2_AfterEvolution);
}
@@ -1223,8 +1222,7 @@ static void Task_TradeEvolutionScene(u8 taskId)
if (!IsTextPrinterActive(0))
{
DestroyTask(taskId);
Free(sEvoStructPtr);
sEvoStructPtr = NULL;
FREE_AND_SET_NULL(sEvoStructPtr);
gTextFlags.useAlternateDownArrow = 0;
SetMainCallback2(gCB2_AfterEvolution);
}