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.
// constructor
-FGBeacon::FGBeacon() :
- inner(NULL),
- middle(NULL),
- outer(NULL)
+FGBeacon::FGBeacon()
{
}
// destructor
FGBeacon::~FGBeacon() {
- delete inner;
- delete middle;
- delete outer;
}
#include <simgear/compiler.h>
#include <simgear/sound/soundmgr_openal.hxx>
+#include <simgear/structure/SGReferenced.hxx>
+#include <simgear/structure/SGSharedPtr.hxx>
#include "morse.hxx"
private:
- SGSoundSample *inner;
- SGSoundSample *middle;
- SGSoundSample *outer;
+ SGSharedPtr<SGSoundSample> inner;
+ SGSharedPtr<SGSoundSample> middle;
+ SGSharedPtr<SGSoundSample> outer;
public: