Skip to content

Commit

Permalink
Try using call_user_callback
Browse files Browse the repository at this point in the history
Signed-off-by: Julian Oes <julian@oes.ch>
  • Loading branch information
julianoes committed Oct 27, 2023
1 parent df9ad7b commit 50c2301
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mavsdk/plugins/ftp/ftp_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ void FtpImpl::list_directory_async(const std::string& path, Ftp::ListDirectoryCa
{
_system_impl->mavlink_ftp_client().list_directory_async(
path, [callback, this](MavlinkFtpClient::ClientResult result, auto&& dirs) {
callback(result_from_mavlink_ftp_result(result), dirs);
if (callback) {
_system_impl->call_user_callback([temp_callback = callback, result, dirs, this]() {
temp_callback(result_from_mavlink_ftp_result(result), dirs);
});
}
});
}

Expand Down

0 comments on commit 50c2301

Please sign in to comment.