diff --git a/src/dexed.cpp b/src/dexed.cpp index bfd3f2e..0f7e49f 100644 --- a/src/dexed.cpp +++ b/src/dexed.cpp @@ -105,6 +105,23 @@ Dexed::~Dexed() { TRACE("Hi"); + if(outbuf_!=NULL) + delete [] outbuf_; + + currentNote = -1; + + for (uint8_t note = 0; note < MAX_ACTIVE_NOTES; ++note) + { + if ( voices[note].dx7_note != NULL ) + { + delete voices[note].dx7_note; + voices[note].dx7_note = NULL; + } + voices[note].keydown = false; + voices[note].sustained = false; + voices[note].live = false; + } + TRACE("Bye"); }