Enable readability-delete-null-pointer clang-tidy check, fix occurrences

#66
This commit is contained in:
Sam V 2021-11-30 00:20:27 +01:00
parent 00fdb36ab9
commit 3f9f9bf9f8
3 changed files with 3 additions and 7 deletions

View file

@ -1,4 +1,4 @@
Checks: '-*,readability-implicit-bool-conversion'
Checks: '-*,readability-delete-null-pointer,readability-implicit-bool-conversion'
CheckOptions:
- key: readability-implicit-bool-conversion.AllowPointerConditions
value: '1'

View file

@ -373,8 +373,7 @@ int CImageLabel::getImageTall()
void CImageLabel::LoadImage(const char* pImageName)
{
if (m_pTGA)
delete m_pTGA;
delete m_pTGA;
// Load the Image
m_pTGA = LoadTGAForRes(pImageName);

View file

@ -493,10 +493,7 @@ void CWorld::Precache()
CVAR_SET_STRING("room_type", "0"); // clear DSP
// Set up game rules
if (g_pGameRules)
{
delete g_pGameRules;
}
delete g_pGameRules;
g_pGameRules = InstallGameRules();