From 0895721e68faa881fbe27a94088a614da1489eb6 Mon Sep 17 00:00:00 2001 From: ehofman Date: Tue, 24 Jan 2006 14:45:13 +0000 Subject: [PATCH] =?utf8?q?Mathias=20Fr=F6hlich:?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Incorporating the shared ptr code: - All scenegraph references from SimGear - SGMaterial which already had a reference counter uses now that common infrastructure. - SGMatModel is now counted. - SGSoundSample from SimGear - And the corresponding change for the sound samples in flightgear which fixes a latent crash if FGBeacon would evern be deleted. --- src/Sound/beacon.cxx | 8 +------- src/Sound/beacon.hxx | 8 +++++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/Sound/beacon.cxx b/src/Sound/beacon.cxx index ddc8750b0..5d9ae9594 100644 --- a/src/Sound/beacon.cxx +++ b/src/Sound/beacon.cxx @@ -25,18 +25,12 @@ // constructor -FGBeacon::FGBeacon() : - inner(NULL), - middle(NULL), - outer(NULL) +FGBeacon::FGBeacon() { } // destructor FGBeacon::~FGBeacon() { - delete inner; - delete middle; - delete outer; } diff --git a/src/Sound/beacon.hxx b/src/Sound/beacon.hxx index 6c7021420..1c2fcd4b6 100644 --- a/src/Sound/beacon.hxx +++ b/src/Sound/beacon.hxx @@ -32,6 +32,8 @@ #include #include +#include +#include #include "morse.hxx" @@ -93,9 +95,9 @@ class FGBeacon { private: - SGSoundSample *inner; - SGSoundSample *middle; - SGSoundSample *outer; + SGSharedPtr inner; + SGSharedPtr middle; + SGSharedPtr outer; public: -- 2.39.5