cwFlowCross.cpp : Fixed memory leaks.

This commit is contained in:
kevin 2021-12-29 21:48:14 -05:00
parent 2601c629e2
commit 2d5673d632

View File

@ -64,7 +64,7 @@ namespace cw
for(unsigned i=0; i<net->deviceN; ++i) for(unsigned i=0; i<net->deviceN; ++i)
if( net->deviceA[i].typeId == flow::kAudioDevTypeId ) if( net->deviceA[i].typeId == flow::kAudioDevTypeId )
{ {
mem::release(net->deviceA[i].u.a.abuf); abuf_destroy(net->deviceA[i].u.a.abuf);
} }
mem::release(net->deviceA); mem::release(net->deviceA);
flow::destroy(net->flowH); flow::destroy(net->flowH);
@ -128,7 +128,7 @@ namespace cw
net->net_idx = net_idx; net->net_idx = net_idx;
if((rc = flow::create( net->flowH, classCfg, networkCfg, net->deviceA, deviceN )) == kOkRC ) if((rc = flow::create( net->flowH, classCfg, networkCfg, net->deviceA, deviceN )) == kOkRC )
net->deviceN += 1; net->deviceN = deviceN;
else else
{ {
cwLogError(rc,"Flow cross index %i network created failed.",net_idx); cwLogError(rc,"Flow cross index %i network created failed.",net_idx);