]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/AIEntity.cxx
The most important part is that it fixes possible
[flightgear.git] / src / ATC / AIEntity.cxx
index 5736f2cbd9e635ad820b6c01e2ea8554acb29350..efcaaee1cc56ce05be481d4185e32cf26939baf8 100644 (file)
@@ -45,7 +45,7 @@ FGAIEntity::FGAIEntity() {
 
 FGAIEntity::~FGAIEntity() {
        //cout << "FGAIEntity dtor called..." << endl;
-       _model->deRef();        // Ought to check valid?
+        ssgDeRefDelete(_model);        // Ought to check valid?
        //cout << "Removing model from scene graph..." << endl;
        globals->get_scenery()->get_scene_graph()->removeKid(_aip.getSceneGraph());
         // Unregister that one at the scenery manager
@@ -68,8 +68,9 @@ void FGAIEntity::SetModel(ssgBranch* model) {
 void FGAIEntity::Update(double dt) {
 }
 
-string FGAIEntity::GetCallsign() {
-       return("");
+const string &FGAIEntity::GetCallsign() {
+       static string s = "";
+       return(s);
 }
 
 void FGAIEntity::RegisterTransmission(int code) {