Skip to content

Commit

Permalink
Merge pull request #2081 from mavlink/pr-no-second-null-system
Browse files Browse the repository at this point in the history
core: don't create a null system if not required
  • Loading branch information
julianoes authored Jun 13, 2023
2 parents ed7ac07 + 15f539d commit 0338c3e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mavsdk/core/mavsdk_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,9 @@ std::pair<ConnectionResult, Mavsdk::ConnectionHandle> MavsdkImpl::setup_udp_remo
new_conn->add_remote(remote_ip, remote_port);
auto handle = add_connection(new_conn);
std::lock_guard<std::recursive_mutex> lock(_systems_mutex);
make_system_with_component(0, 0);
if (_systems.empty()) {
make_system_with_component(0, 0);
}
return {ret, handle};
} else {
return {ret, Mavsdk::ConnectionHandle{}};
Expand Down

0 comments on commit 0338c3e

Please sign in to comment.