cwWaveTableBank.h/cpp : Fixed memory leak and added loadThreadCnt arg. to create().
This commit is contained in:
parent
b19671dbdc
commit
e6524ea945
@ -168,6 +168,7 @@ namespace cw
|
||||
for(unsigned i=0; i<p->instrN; ++i )
|
||||
_destroy_instr(p->instrA[i]);
|
||||
|
||||
mem::release(p->instrA);
|
||||
mem::release(p);
|
||||
return rc;
|
||||
}
|
||||
@ -396,7 +397,7 @@ namespace cw
|
||||
}
|
||||
|
||||
|
||||
cw::rc_t cw::wt_bank::create( handle_t& hRef, unsigned padSmpN, const char* instr_json_fname )
|
||||
cw::rc_t cw::wt_bank::create( handle_t& hRef, unsigned padSmpN, const char* instr_json_fname, unsigned loadThreadCnt )
|
||||
{
|
||||
rc_t rc = kOkRC;
|
||||
|
||||
@ -409,7 +410,7 @@ cw::rc_t cw::wt_bank::create( handle_t& hRef, unsigned padSmpN, const char* inst
|
||||
hRef.set(p);
|
||||
|
||||
if( instr_json_fname != nullptr )
|
||||
if((rc = load(hRef,instr_json_fname)) != kOkRC )
|
||||
if((rc = load(hRef,instr_json_fname,loadThreadCnt)) != kOkRC )
|
||||
{
|
||||
hRef.clear();
|
||||
}
|
||||
@ -536,6 +537,7 @@ errLabel:
|
||||
|
||||
//_audio_buf_free(abuf);
|
||||
|
||||
mem::release(argsA);
|
||||
mem::release(taskA);
|
||||
destroy(threadTasksH);
|
||||
|
||||
|
@ -19,7 +19,7 @@ namespace cw
|
||||
typedef struct dsp::multi_ch_wt_seq_osc::multi_ch_wt_seq_str<sample_t,srate_t> multi_ch_wt_seq_t;
|
||||
|
||||
|
||||
rc_t create( handle_t& hRef, unsigned padSmpN, const char* instr_json_fname=nullptr );
|
||||
rc_t create( handle_t& hRef, unsigned padSmpN, const char* instr_json_fname=nullptr, unsigned loadThreadCnt=16 );
|
||||
rc_t destroy( handle_t& hRef );
|
||||
|
||||
void report( handle_t h );
|
||||
|
Loading…
Reference in New Issue
Block a user