]> git.mxchange.org Git - flightgear.git/commitdiff
Mathias Fröhlich:
authorehofman <ehofman>
Tue, 24 Jan 2006 14:45:13 +0000 (14:45 +0000)
committerehofman <ehofman>
Tue, 24 Jan 2006 14:45:13 +0000 (14:45 +0000)
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
src/Sound/beacon.hxx

index ddc8750b0f828e60b17a6a068f916e71e5fbe444..5d9ae959414107972bae401fcdd04d10853f244e 100644 (file)
 
 
 // constructor
-FGBeacon::FGBeacon() :
-    inner(NULL),
-    middle(NULL),
-    outer(NULL)
+FGBeacon::FGBeacon()
 {
 }
 
 // destructor
 FGBeacon::~FGBeacon() {
-    delete inner;
-    delete middle;
-    delete outer;
 }
 
 
index 6c70214201c1c257bf4c8ef42d0c893124f68ce3..1c2fcd4b64539c030684b74bfdc7b48928dda0cc 100644 (file)
@@ -32,6 +32,8 @@
 
 #include <simgear/compiler.h>
 #include <simgear/sound/soundmgr_openal.hxx>
+#include <simgear/structure/SGReferenced.hxx>
+#include <simgear/structure/SGSharedPtr.hxx>
 
 #include "morse.hxx"
 
@@ -93,9 +95,9 @@ class FGBeacon {
 
 private:
 
-    SGSoundSample *inner;
-    SGSoundSample *middle;
-    SGSoundSample *outer;
+    SGSharedPtr<SGSoundSample> inner;
+    SGSharedPtr<SGSoundSample> middle;
+    SGSharedPtr<SGSoundSample> outer;
 
 public: