From d4762eedd6db42e11e6774ccab9cc9a1c011a704 Mon Sep 17 00:00:00 2001 From: Jorj Bauer Date: Wed, 20 Feb 2019 23:12:39 -0500 Subject: [PATCH] dynamically free woz image data --- apple/woz.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/apple/woz.cpp b/apple/woz.cpp index 95aa3f8..81f7faf 100644 --- a/apple/woz.cpp +++ b/apple/woz.cpp @@ -43,10 +43,22 @@ Woz::Woz() Woz::~Woz() { - // FIXME: free all the stuff - - if (fh != -1) + if (fh != -1) { g_filemanager->closeFile(fh); + fh = -1; + } + + for (int i=0; i<160; i++) { + if (tracks[i].trackData) { + free(tracks[i].trackData); + tracks[i].trackData = NULL; + } + } + + if (metaData) { + free(metaData); + metaData = NULL; + } }