From: ehofman Date: Tue, 24 Jan 2006 14:45:13 +0000 (+0000) Subject: Mathias Fröhlich: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0895721e68faa881fbe27a94088a614da1489eb6;p=flightgear.git Mathias Fröhlich: 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. --- 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: