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); }