mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
mavlink_receiver: check for allocation failure
Also remove the start() declration (there's no definition of that)
This commit is contained in:
@@ -2493,6 +2493,11 @@ void *MavlinkReceiver::start_helper(void *context)
|
||||
|
||||
MavlinkReceiver *rcv = new MavlinkReceiver((Mavlink *)context);
|
||||
|
||||
if (!rcv) {
|
||||
PX4_ERR("alloc failed");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void *ret = rcv->receive_thread(nullptr);
|
||||
|
||||
delete rcv;
|
||||
|
||||
@@ -99,13 +99,6 @@ public:
|
||||
*/
|
||||
~MavlinkReceiver();
|
||||
|
||||
/**
|
||||
* Start the mavlink task.
|
||||
*
|
||||
* @return OK on success.
|
||||
*/
|
||||
int start();
|
||||
|
||||
/**
|
||||
* Display the mavlink status.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user