From 8333bc68761b8329c1f3131c834f17b8927f65d6 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sun, 8 Jan 2017 09:58:00 -0800 Subject: [PATCH] Allow fallback to first link even with no serial --- src/Vehicle/Vehicle.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index f5a8b5b59..9b3bc66be 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -979,9 +979,9 @@ void Vehicle::_sendMessageOnLink(LinkInterface* link, mavlink_message_t message) void Vehicle::_updatePriorityLink(void) { -#ifndef NO_SERIAL_LINK LinkInterface* newPriorityLink = NULL; +#ifndef NO_SERIAL_LINK // Note that this routine specificallty does not clear _priorityLink when there are no links remaining. // By doing this we hold a reference on the last link as the Vehicle shuts down. Thus preventing shutdown // ordering NULL pointer crashes where priorityLink() is still called during shutdown sequence. @@ -1004,6 +1004,7 @@ void Vehicle::_updatePriorityLink(void) } } } +#endif if (!newPriorityLink && !_priorityLink.data() && _links.count()) { newPriorityLink = _links[0]; @@ -1012,7 +1013,6 @@ void Vehicle::_updatePriorityLink(void) if (newPriorityLink) { _priorityLink = qgcApp()->toolbox()->linkManager()->sharedLinkInterfacePointerForLink(newPriorityLink); } -#endif } void Vehicle::setLatitude(double latitude) -- 2.22.0