From 0e4211fd34c20a5831e6f96125bc7ad8dd1f091f Mon Sep 17 00:00:00 2001 From: root Date: Wed, 30 Aug 2017 13:03:41 +0200 Subject: [PATCH] Added checks for NULL - just to be sure. --- src/dexed.cpp | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/dexed.cpp b/src/dexed.cpp index 7eabe23..3becf0b 100644 --- a/src/dexed.cpp +++ b/src/dexed.cpp @@ -49,12 +49,28 @@ Dexed::Dexed(double rate) : lvtk::Synth(p_n_ports, p_midi_in) Env::init_sr(rate); fx.init(rate); - engineMkI=new EngineMkI; - engineOpl=new EngineOpl; - engineMsfa=new FmCore; + if((engineMkI=new EngineMkI)==NULL) + { + 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(p_n_ports, p_midi_in) bufsize_=256; - outbuf_=new float[bufsize_]; + if((outbuf_=new float[bufsize_])==NULL) + { + TRACE("Cannot create outbuf_ buffer"); + exit(404); + } lfo.reset(data+137);