Added checks for NULL - just to be sure.

pull/2/head
root 7 years ago
parent 2413bf4210
commit 0e4211fd34
  1. 30
      src/dexed.cpp

@ -49,12 +49,28 @@ Dexed::Dexed(double rate) : lvtk::Synth<DexedVoice, Dexed>(p_n_ports, p_midi_in)
Env::init_sr(rate); Env::init_sr(rate);
fx.init(rate); fx.init(rate);
engineMkI=new EngineMkI; if((engineMkI=new EngineMkI)==NULL)
engineOpl=new EngineOpl; {
engineMsfa=new FmCore; TRACE("Cannot not create engine EngineMkI");
exit(400);
}
if((engineOpl=new EngineOpl)==NULL)
{
TRACE("Cannot not create engine EngineOpl");
exit(401);
}
if((engineMsfa=new FmCore)==NULL)
{
TRACE("Cannot create engine FmCore");
exit(402);
}
for(i=0; i<MAX_ACTIVE_NOTES; i++) { for(i=0; i<MAX_ACTIVE_NOTES; i++) {
voices[i].dx7_note = new Dx7Note; if((voices[i].dx7_note = new Dx7Note)==NULL)
{
TRACE("Cannot create engine FmCore");
exit(403);
}
voices[i].keydown = false; voices[i].keydown = false;
voices[i].sustained = false; voices[i].sustained = false;
voices[i].live = false; voices[i].live = false;
@ -80,7 +96,11 @@ Dexed::Dexed(double rate) : lvtk::Synth<DexedVoice, Dexed>(p_n_ports, p_midi_in)
bufsize_=256; bufsize_=256;
outbuf_=new float[bufsize_]; if((outbuf_=new float[bufsize_])==NULL)
{
TRACE("Cannot create outbuf_ buffer");
exit(404);
}
lfo.reset(data+137); lfo.reset(data+137);

Loading…
Cancel
Save