]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/xmlsound.cxx
Use a reference counted pointer for the condition.
[simgear.git] / simgear / sound / xmlsound.cxx
index 5d6490b99a74afee4c47470ff407ed3ed66a6c28..474386039fd6147fa66dc128b61edc3476801dd8 100644 (file)
@@ -47,7 +47,7 @@ static double _snd_log(double v)   { return log(fabs(v)); }
 // static double _snd_pow3(double v)  { return v*v*v; }
 
 static const struct {
-       char *name;
+       const char *name;
        double (*fn)(double);
 } __sound_fn[] = {
 //     {"lin", _snd_lin},
@@ -63,7 +63,6 @@ static const struct {
 
 SGXmlSound::SGXmlSound()
   : _sample(NULL),
-    _condition(NULL),
     _active(false),
     _name(""),
     _mode(SGXmlSound::ONCE),
@@ -80,8 +79,6 @@ SGXmlSound::~SGXmlSound()
     if (_sample)
         _sample->stop();
 
-    delete _condition;
-
     _volume.clear();
     _pitch.clear();
 }
@@ -128,7 +125,7 @@ SGXmlSound::init(SGPropertyNode *root, SGPropertyNode *node, SGSoundMgr *sndmgr,
    //
    unsigned int i;
    float v = 0.0;
-   vector<SGPropertyNode_ptr> kids = node->getChildren("volume");
+   std::vector<SGPropertyNode_ptr> kids = node->getChildren("volume");
    for (i = 0; (i < kids.size()) && (i < SGXmlSound::MAXPROP); i++) {
       _snd_prop volume = {NULL, NULL, NULL, 1.0, 0.0, 0.0, 0.0, false};