X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FSound%2Ffg_fx.cxx;h=5537bb1195b80743a59005658aa6499ed1829383;hb=db89cf202adc795b27e1bbf85162e8ec137a760d;hp=e21a0c2aa619c8d99bb4e92ba711ce5a44f3132a;hpb=ac5e874523dde364fb6d818cf60643c6fa0fa83f;p=flightgear.git diff --git a/src/Sound/fg_fx.cxx b/src/Sound/fg_fx.cxx index e21a0c2aa..5537bb119 100644 --- a/src/Sound/fg_fx.cxx +++ b/src/Sound/fg_fx.cxx @@ -25,6 +25,10 @@ #pragma warning (disable: 4786) #endif +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #ifdef __BORLANDC__ @@ -81,7 +85,7 @@ FGFX::init() SGPropertyNode root; try { readProperties(path.str(), &root); - } catch (const sg_exception &e) { + } catch (const sg_exception &) { SG_LOG(SG_GENERAL, SG_ALERT, "Incorrect path specified in configuration file"); return; @@ -91,10 +95,15 @@ FGFX::init() for (i = 0; i < node->nChildren(); i++) { SGXmlSound *sound = new SGXmlSound(); - sound->init(globals->get_props(), node->getChild(i), - globals->get_soundmgr(), globals->get_fg_root()); + try { + sound->init(globals->get_props(), node->getChild(i), + globals->get_soundmgr(), globals->get_fg_root()); - _sound.push_back(sound); + _sound.push_back(sound); + } catch ( sg_io_exception &e ) { + SG_LOG(SG_GENERAL, SG_ALERT, e.getFormattedMessage()); + delete sound; + } } }