diff --git a/cwIoMidiRecordPlay.cpp b/cwIoMidiRecordPlay.cpp index 09ba658..720deda 100644 --- a/cwIoMidiRecordPlay.cpp +++ b/cwIoMidiRecordPlay.cpp @@ -1298,11 +1298,12 @@ cw::rc_t cw::midi_record_play::create( handle_t& hRef, io::handle_t ioH, const o return rc; p = mem::allocZ(); + + p->ioH = ioH; // p->ioH is used in _destory() so initialize it here if((rc = _parseCfg(p,cfg)) != kOkRC ) goto errLabel; - p->ioH = ioH; p->cb = cb; p->cb_arg = cb_arg; p->halfPedalState = kHalfPedalDone;