From: mfranz Date: Sun, 30 Oct 2005 10:50:36 +0000 (+0000) Subject: Harald JOHNSEN: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=853d19e09b1776e616f8a07bec9ed54cb5bee3cc;p=flightgear.git Harald JOHNSEN: "the model is deref'd and deleted when the refcount is null *but* it is still referenced in the ai model list, so next time you ask for it you will have a reference on something deleted" --- diff --git a/src/AIModel/AIManager.cxx b/src/AIModel/AIManager.cxx index 8b7154059..e20376516 100644 --- a/src/AIModel/AIManager.cxx +++ b/src/AIModel/AIManager.cxx @@ -444,6 +444,8 @@ ssgBranch * FGAIManager::getModel(const string& path) const void FGAIManager::setModel(const string& path, ssgBranch *model) { + if (model) + model->ref(); loadedModels.push_back(FGModelID(path,model)); }