From 0ab97746c842793c3a05933d34e66a8b1e897be1 Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 11 Feb 2003 20:26:42 +0000 Subject: [PATCH] Erik Hofman: Adds some small updates to the sound code (add vector clearing in destructors). --- src/Sound/fg_fx.cxx | 3 +-- src/Sound/fg_sound.cxx | 3 +++ src/Sound/fg_sound.hxx | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Sound/fg_fx.cxx b/src/Sound/fg_fx.cxx index c7c7a17d7..527a5f3a4 100644 --- a/src/Sound/fg_fx.cxx +++ b/src/Sound/fg_fx.cxx @@ -45,8 +45,7 @@ FGFX::FGFX () FGFX::~FGFX () { - for (unsigned int i = 0; i < _sound.size(); i++ ) - delete _sound[i]; + _sound.clear(); } void diff --git a/src/Sound/fg_sound.cxx b/src/Sound/fg_sound.cxx index 9f20d3b6d..9f76ce0ac 100644 --- a/src/Sound/fg_sound.cxx +++ b/src/Sound/fg_sound.cxx @@ -83,6 +83,9 @@ FGSound::~FGSound() if (_condition) delete _condition; + _volume.clear(); + _pitch.clear(); + delete _sample; } diff --git a/src/Sound/fg_sound.hxx b/src/Sound/fg_sound.hxx index ce66e13a3..4d4824bb4 100644 --- a/src/Sound/fg_sound.hxx +++ b/src/Sound/fg_sound.hxx @@ -33,7 +33,7 @@ #include "soundmgr.hxx" -static const double MAX_TRANSIT_TIME = 0.1; // 10 ms. +static const double MAX_TRANSIT_TIME = 0.1; // 100 ms. /**