Add Address Sanitizer suppression list.

This replaces the unnecessary deallocations on program termination.
Passing in the suppression list environment variable via setenv()
doesn't seem to work, so I've added a comment in the Makefile to explain
invocation.
This commit is contained in:
2020-09-24 03:12:24 +02:00
parent c33f218e56
commit 006d1000c7
5 changed files with 5 additions and 22 deletions

View File

@@ -6,12 +6,6 @@
std::map<std::pair<int, int>, Chunk*> ChunkManager::chunks;
void ChunkManager::init() {} // stubbed
void ChunkManager::cleanup() {
// cleans up all the allocated chunks
for (auto& pair : chunks) {
delete pair.second;
}
}
void ChunkManager::addNPC(int posX, int posY, int32_t id) {
std::pair<int, int> pos = grabChunk(posX, posY);

View File

@@ -189,19 +189,6 @@ void TableData::init() {
}
}
void TableData::cleanup() {
/*
* This is just to shut the address sanitizer up. Dynamically allocated data
* doesn't need to be cleaned up if it's supposed to last the program's full runtime.
*/
for (auto& pair : MissionManager::Rewards)
delete pair.second;
for (auto& pair : MissionManager::Tasks)
delete pair.second;
for (auto& pair : NPCManager::NPCs)
delete pair.second;
}
/*
* Some item categories either don't possess iEquipLoc or use a different value for item type.
*/

View File

@@ -49,9 +49,6 @@ void terminate(int arg) {
shardThread->join();
}
TableData::cleanup();
ChunkManager::cleanup();
exit(0);
}