From 4b74636d044b7e73020d66b19ac1a3dc7daa5a3a Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sat, 19 Mar 2011 14:51:39 +0100 Subject: [PATCH] Avoid nuisance sound effects after sim-reset. --- src/Model/acmodel.cxx | 3 ++- src/Model/acmodel.hxx | 2 +- src/Sound/fg_fx.cxx | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) 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(); }; -- 2.39.5