From 24e6e0fd254d73012ff9eae6582929fc3004d426 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Wed, 10 Jan 2018 21:29:25 -0600 Subject: [PATCH] Properly free main/aux memory --- src/apple2.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/apple2.c b/src/apple2.c index 272ba4d..083b760 100644 --- a/src/apple2.c +++ b/src/apple2.c @@ -46,6 +46,7 @@ apple2_create(int width, int height) // properly; that way, we won't try to free garbage data mach->rom = NULL; mach->ram2 = NULL; + mach->main = NULL; mach->sysfont = NULL; mach->screen = NULL; mach->drive1 = NULL; @@ -265,6 +266,14 @@ apple2_free(apple2 *mach) vm_segment_free(mach->ram2); } + if (mach->main) { + vm_segment_free(mach->main); + } + + if (mach->aux) { + vm_segment_free(mach->aux); + } + if (mach->sysfont) { vm_bitfont_free(mach->sysfont); }