]> git.mxchange.org Git - flightgear.git/blobdiff - src/Model/modelmgr.cxx
Make sure that all elapsed time gets passed to update when a subsystem
[flightgear.git] / src / Model / modelmgr.cxx
index 3507cc4f6e36839709acc9d87fc1dd246e51173b..29693ecf1e11ef2218fa28c2966cbcf99242733e 100644 (file)
@@ -133,8 +133,14 @@ FGModelMgr::add_instance (Instance * instance)
 void
 FGModelMgr::remove_instance (Instance * instance)
 {
-    _instances.erase(find(_instances.begin(), _instances.end(), instance));
-    delete instance;
+    vector<Instance *>::iterator it;
+    for (it = _instances.begin(); it != _instances.end(); it++) {
+        if (*it == instance) {
+            _instances.erase(it);
+            delete instance;
+            return;
+        }
+    }
 }
 
 void