mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Use std::unique_ptr for rgblink sections (#1337)
This commit is contained in:
@@ -346,19 +346,6 @@ next:
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static void freeSection(Section §ion) {
|
||||
Section *next = §ion;
|
||||
|
||||
for (Section *nextu; next; next = nextu) {
|
||||
nextu = next->nextu;
|
||||
delete next;
|
||||
};
|
||||
}
|
||||
|
||||
static void freeSections() {
|
||||
sect_ForEach(freeSection);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
// Parse options
|
||||
for (int ch; (ch = musl_getopt_long_only(argc, argv, optstring, longopts, nullptr)) != -1;) {
|
||||
@@ -462,10 +449,6 @@ 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(freeSections);
|
||||
|
||||
// Read all object files first,
|
||||
for (obj_Setup(argc - curArgIndex); curArgIndex < argc; curArgIndex++)
|
||||
obj_ReadFile(argv[curArgIndex], argc - curArgIndex - 1);
|
||||
|
||||
Reference in New Issue
Block a user