From: ThorstenB Date: Sat, 19 Mar 2011 13:51:39 +0000 (+0100) Subject: Avoid nuisance sound effects after sim-reset. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4b74636d044b7e73020d66b19ac1a3dc7daa5a3a;p=flightgear.git Avoid nuisance sound effects after sim-reset. --- diff --git a/src/Model/acmodel.cxx b/src/Model/acmodel.cxx index 5c63963a9..3c9faaf23 100644 --- a/src/Model/acmodel.cxx +++ b/src/Model/acmodel.cxx @@ -1,4 +1,4 @@ -// model.cxx - manage a 3D aircraft model. +// acmodel.cxx - manage a 3D aircraft model. // Written by David Megginson, started 2002. // // This file is in the Public Domain, and comes with no warranty. @@ -84,6 +84,7 @@ void FGAircraftModel::reinit() { deinit(); + _fx->reinit(); init(); } diff --git a/src/Model/acmodel.hxx b/src/Model/acmodel.hxx index 7965658cd..b774874d2 100644 --- a/src/Model/acmodel.hxx +++ b/src/Model/acmodel.hxx @@ -1,4 +1,4 @@ -// model.hxx - manage a 3D aircraft model. +// acmodel.hxx - manage a 3D aircraft model. // Written by David Megginson, started 2002. // // This file is in the Public Domain, and comes with no warranty. diff --git a/src/Sound/fg_fx.cxx b/src/Sound/fg_fx.cxx index ab0ace0a9..f60f44114 100644 --- a/src/Sound/fg_fx.cxx +++ b/src/Sound/fg_fx.cxx @@ -109,6 +109,9 @@ FGFX::init() void FGFX::reinit() { + for ( unsigned int i = 0; i < _sound.size(); i++ ) { + delete _sound[i]; + } _sound.clear(); init(); };