Skip to content

Commit

Permalink
core: clean up message registrations
Browse files Browse the repository at this point in the history
Signed-off-by: Julian Oes <[email protected]>
  • Loading branch information
julianoes committed Oct 23, 2023
1 parent f218021 commit 74fb8cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mavsdk/core/mavlink_ftp_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ MavlinkFtpClient::MavlinkFtpClient(SystemImpl& system_impl) : _system_impl(syste
this);
}

MavlinkFtpClient::~MavlinkFtpClient() {}
MavlinkFtpClient::~MavlinkFtpClient()
{
_system_impl.unregister_all_mavlink_message_handlers(this);
}

void MavlinkFtpClient::do_work()
{
Expand Down
2 changes: 2 additions & 0 deletions src/mavsdk/core/mavlink_ftp_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ void MavlinkFtpServer::process_mavlink_ftp_message(const mavlink_message_t& msg)

MavlinkFtpServer::~MavlinkFtpServer()
{
_server_component_impl.unregister_all_mavlink_message_handlers(this);

std::lock_guard<std::mutex> lock(_mutex);
_reset();
}
Expand Down

0 comments on commit 74fb8cd

Please sign in to comment.