]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIManager.cxx
allow to trigger widgets via accelerator key, which is defined via "keynum"
[flightgear.git] / src / AIModel / AIManager.cxx
index 96742864e3fb574593e04a542ef3fa9ee0b84cd3..e20376516996d86bc7d44880be7ee11c5cf42fd1 100644 (file)
@@ -397,7 +397,7 @@ void FGAIManager::processThermal( FGAIThermal* thermal ) {
 void FGAIManager::processScenario( const string &filename ) {
   FGAIScenario* s = new FGAIScenario( filename );
   for (int i=0;i<s->nEntries();i++) {
-    FGAIModelEntity* en = s->getNextEntry();
+   FGAIModelEntity* const en = s->getNextEntry();
 
     if (en) {
       if ( en->m_type == "aircraft") {
@@ -430,7 +430,7 @@ void FGAIManager::processScenario( const string &filename ) {
 // This code keeps track of models that have already been loaded
 // Eventually we'd prbably need to find a way to keep track of models
 // that are unloaded again
-ssgBranch * FGAIManager::getModel(const string& path)
+ssgBranch * FGAIManager::getModel(const string& path) const
 {
   ModelVecIterator i = loadedModels.begin();
   while (i != loadedModels.end())
@@ -444,6 +444,8 @@ ssgBranch * FGAIManager::getModel(const string& path)
 
 void FGAIManager::setModel(const string& path, ssgBranch *model)
 {
+  if (model)
+    model->ref();
   loadedModels.push_back(FGModelID(path,model));
 }