Fix MapEdit memory errors

deleteThis() was called on NULL pointers.
Deleting individual nodes shouldn't be necessary if the whole structure
(pkvFile) is deleted anyways.
This commit is contained in:
Alexander 'z33ky' Hirsch 2021-05-23 12:11:26 +02:00
parent 098486fbe4
commit 78ef9f2019

View File

@ -409,7 +409,6 @@ public:
pkvClassname = pkvClassname->GetNextKey(); pkvClassname = pkvClassname->GetNextKey();
} }
pkvClassname->deleteThis();
} }
else if (FStrEq(pNodeName, "edit")) else if (FStrEq(pNodeName, "edit"))
{ {
@ -432,7 +431,6 @@ public:
pName = pName->GetNextKey(); pName = pName->GetNextKey();
} }
pName->deleteThis();
} }
else if (FStrEq(pNodeName, "delete")) else if (FStrEq(pNodeName, "delete"))
{ {
@ -455,7 +453,6 @@ public:
pName = pName->GetNextKey(); pName = pName->GetNextKey();
} }
pName->deleteThis();
} }
else if (FStrEq(pNodeName, "fire")) else if (FStrEq(pNodeName, "fire"))
{ {
@ -525,12 +522,10 @@ public:
pkvNodeData = pkvNodeData->GetNextKey(); pkvNodeData = pkvNodeData->GetNextKey();
} }
pkvNodeData->deleteThis();
} }
pkvNode = pkvNode->GetNextKey(); pkvNode = pkvNode->GetNextKey();
} }
pkvNode->deleteThis();
} }
void SpawnMapEdit(const char *pFile = NULL) void SpawnMapEdit(const char *pFile = NULL)
@ -889,8 +884,8 @@ void CC_MapEdit_Print( const CCommand& args )
pkvNode = pkvNode->GetNextKey(); pkvNode = pkvNode->GetNextKey();
} }
pkvNode->deleteThis();
} }
pkvFile->deleteThis();
} }
} }
static ConCommand mapedit_print("mapedit_print", CC_MapEdit_Print, "Prints a mapedit file in the console."); static ConCommand mapedit_print("mapedit_print", CC_MapEdit_Print, "Prints a mapedit file in the console.");