Mathias Frhlich:
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.
This commit is contained in:
parent
907b99a669
commit
0895721e68
2 changed files with 6 additions and 10 deletions
|
@ -25,18 +25,12 @@
|
||||||
|
|
||||||
|
|
||||||
// constructor
|
// constructor
|
||||||
FGBeacon::FGBeacon() :
|
FGBeacon::FGBeacon()
|
||||||
inner(NULL),
|
|
||||||
middle(NULL),
|
|
||||||
outer(NULL)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// destructor
|
// destructor
|
||||||
FGBeacon::~FGBeacon() {
|
FGBeacon::~FGBeacon() {
|
||||||
delete inner;
|
|
||||||
delete middle;
|
|
||||||
delete outer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
|
|
||||||
#include <simgear/compiler.h>
|
#include <simgear/compiler.h>
|
||||||
#include <simgear/sound/soundmgr_openal.hxx>
|
#include <simgear/sound/soundmgr_openal.hxx>
|
||||||
|
#include <simgear/structure/SGReferenced.hxx>
|
||||||
|
#include <simgear/structure/SGSharedPtr.hxx>
|
||||||
|
|
||||||
#include "morse.hxx"
|
#include "morse.hxx"
|
||||||
|
|
||||||
|
@ -93,9 +95,9 @@ class FGBeacon {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
SGSoundSample *inner;
|
SGSharedPtr<SGSoundSample> inner;
|
||||||
SGSoundSample *middle;
|
SGSharedPtr<SGSoundSample> middle;
|
||||||
SGSoundSample *outer;
|
SGSharedPtr<SGSoundSample> outer;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue