Use the TRY_FREE_AND_SET_NULL macro where appropriate

This commit is contained in:
sphericalice
2022-06-03 15:42:53 +01:00
parent a7b6dfee3a
commit d03756dfd2
10 changed files with 24 additions and 53 deletions

View File

@@ -1672,8 +1672,7 @@ static bool8 InitEasyChatScreenStruct(u8 type, u16 *words, u8 displayedPersonTyp
static void FreeEasyChatScreenStruct(void)
{
if (sEasyChatScreen != NULL)
FREE_AND_SET_NULL(sEasyChatScreen);
TRY_FREE_AND_SET_NULL(sEasyChatScreen);
}
// Returns the function ID of the action to take as a result of player's input.
@@ -3075,8 +3074,7 @@ static bool8 LoadEasyChatScreen(void)
static void FreeEasyChatScreenControl(void)
{
if (sScreenControl)
FREE_AND_SET_NULL(sScreenControl);
TRY_FREE_AND_SET_NULL(sScreenControl);
}
static void StartEasyChatFunction(u16 funcId)
@@ -5573,8 +5571,7 @@ static bool8 InitEasyChatScreenWordData(void)
static void FreeEasyChatScreenWordData(void)
{
if (sWordData)
FREE_AND_SET_NULL(sWordData);
TRY_FREE_AND_SET_NULL(sWordData);
}
static void SetUnlockedEasyChatGroups(void)