From 0d644c928131b34fc73bc1253242d014ecf5879c Mon Sep 17 00:00:00 2001 From: kevin Date: Mon, 30 Jan 2023 19:23:42 -0500 Subject: [PATCH] cwIoMidiRecordPlay.cpp : Change the location where p->ioH is initialized in create() to guarantee that it is valid in _destroy(). --- cwIoMidiRecordPlay.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;