From: James Turner Date: Mon, 21 Oct 2013 22:36:52 +0000 (+0100) Subject: Fix an MSVC debug crash. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=47ecc0ce29a802974dedbb341abc7560cf7a89ef;p=flightgear.git Fix an MSVC debug crash. Ensure the route-manger unregisters itself from the flightplan on destruction, since it is a delegate. --- diff --git a/src/Autopilot/route_mgr.cxx b/src/Autopilot/route_mgr.cxx index 71dddb30b..fd46f4be7 100644 --- a/src/Autopilot/route_mgr.cxx +++ b/src/Autopilot/route_mgr.cxx @@ -234,6 +234,10 @@ FGRouteMgr::~FGRouteMgr() input->removeChangeListener(listener); delete listener; + if (_plan) { + _plan->removeDelegate(this); + } + //SGCommandMgr* cmdMgr = SGCommandMgr::instance(); //cmdMgr->removeCommand("define-user-waypoint");