X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fmk_viii.cxx;h=118d740b70e64584758f257e336d4d9fa9e6bfe4;hb=3f1af3334fe5368d9286d5971576c63093f56992;hp=942c679041bcd2cfd45b34bf428c6bc6a6867d15;hpb=5128578f5979600ff56180efbdd7fef75279e07c;p=flightgear.git diff --git a/src/Instrumentation/mk_viii.cxx b/src/Instrumentation/mk_viii.cxx index 942c67904..118d740b7 100755 --- a/src/Instrumentation/mk_viii.cxx +++ b/src/Instrumentation/mk_viii.cxx @@ -235,7 +235,7 @@ MK_VIII::PropertiesHandler::init () void MK_VIII::PropertiesHandler::unbind () { - vector::iterator iter; + vector::iterator iter; for (iter = tied_properties.begin(); iter != tied_properties.end(); iter++) (*iter)->untie(); @@ -2299,7 +2299,13 @@ MK_VIII::VoicePlayer::get_sample (const char *name) std::ostringstream refname; refname << mk->name << "[" << mk->num << "]" << "/" << name; - SGSoundSample *sample = globals->get_soundmgr()->find(refname.str()); + SGSoundMgr *soundmgr = globals->get_soundmgr(); + if (soundmgr->is_working() == false) + { + return NULL; + } + + SGSoundSample *sample = soundmgr->find(refname.str()); if (! sample) { SGPath sample_path(globals->get_fg_root()); @@ -2316,7 +2322,7 @@ MK_VIII::VoicePlayer::get_sample (const char *name) exit(1); } - globals->get_soundmgr()->add(sample, refname.str()); + soundmgr->add(sample, refname.str()); samples[refname.str()] = sample; }