|
|
|
@ -37,15 +37,14 @@ AP_GPS_UAVCAN::AP_GPS_UAVCAN(AP_GPS &_gps, AP_GPS::GPS_State &_state, AP_HAL::UA
@@ -37,15 +37,14 @@ AP_GPS_UAVCAN::AP_GPS_UAVCAN(AP_GPS &_gps, AP_GPS::GPS_State &_state, AP_HAL::UA
|
|
|
|
|
// For each instance we need to deregister from AP_UAVCAN class
|
|
|
|
|
AP_GPS_UAVCAN::~AP_GPS_UAVCAN() |
|
|
|
|
{ |
|
|
|
|
if (hal.can_mgr[_manager] == nullptr) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
AP_UAVCAN *ap_uavcan = hal.can_mgr[_manager]->get_UAVCAN(); |
|
|
|
|
AP_UAVCAN *ap_uavcan = AP_UAVCAN::get_uavcan(_manager); |
|
|
|
|
if (ap_uavcan == nullptr) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ap_uavcan->remove_gps_listener(this); |
|
|
|
|
delete _sem_gnss; |
|
|
|
|
|
|
|
|
|
debug_gps_uavcan(2, "AP_GPS_UAVCAN destructed\n\r"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|