Use std::deque for symbol lists

Also fix a memory leak that this reveals
This commit is contained in:
Rangi42
2024-02-21 13:15:30 -05:00
committed by Sylvie
parent bc8cb754c0
commit d5de3fa111
2 changed files with 22 additions and 28 deletions

View File

@@ -422,6 +422,10 @@ int main(int argc, char *argv[])
if (isDmgMode)
sectionTypeInfo[SECTTYPE_VRAM].lastBank = 0;
// Do cleanup before quitting, though.
// Mostly here to please tools such as `valgrind` so actual errors can be seen
atexit(obj_Cleanup);
// Read all object files first,
for (obj_Setup(argc - curArgIndex); curArgIndex < argc; curArgIndex++)
obj_ReadFile(argv[curArgIndex], argc - curArgIndex - 1);
@@ -450,8 +454,4 @@ int main(int argc, char *argv[])
if (nbErrors != 0)
reportErrors();
out_WriteFiles();
// Do cleanup before quitting, though.
// Mostly here to please tools such as `valgrind` so actual errors can be seen
obj_Cleanup();
}