]> git.mxchange.org Git - flightgear.git/blobdiff - src/Model/panelnode.cxx
NavDisplay: fix update lag when switching range or centre.
[flightgear.git] / src / Model / panelnode.cxx
index be6889fda55d048d80e0a63044be888fcfbb5d82..7161daa2c57029eb44a1eeacc02fb9274079bdbf 100644 (file)
@@ -6,6 +6,7 @@
 #include <simgear/structure/exception.hxx>
 
 #include <vector>
+#include <algorithm>
 
 #include <Cockpit/panel.hxx>
 #include <Cockpit/panel_io.hxx>
@@ -119,6 +120,11 @@ FGPanelNode::FGPanelNode(SGPropertyNode* props)
 
 FGPanelNode::~FGPanelNode()
 {
+    vector<FGPanelNode*>::iterator i =
+      find(all_3d_panels.begin(), all_3d_panels.end(), this);
+    if (i != all_3d_panels.end()) {
+        all_3d_panels.erase(i);
+    }
     delete _panel;
 }