From ef479435bfd7845cb73dd4d0c6ef15557e38c407 Mon Sep 17 00:00:00 2001 From: Rob Walworth Date: Thu, 21 Sep 2023 16:01:25 -0500 Subject: [PATCH] Fix Client move constructor bug Signed-off-by: Rob Walworth --- sdk/main/src/Client.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sdk/main/src/Client.cc b/sdk/main/src/Client.cc index e14d5fcbb..6371ebf27 100644 --- a/sdk/main/src/Client.cc +++ b/sdk/main/src/Client.cc @@ -117,6 +117,7 @@ Client::~Client() //----- Client::Client(Client&& other) noexcept + : mImpl(std::make_unique()) { moveClient(std::move(other)); @@ -436,6 +437,7 @@ void Client::cancelScheduledNetworkUpdate() //----- void Client::moveClient(Client&& other) { + // Cancel this Client's network update if one exists. cancelScheduledNetworkUpdate(); // If there's a network update thread running in the moved-from Client, it can't be simply moved. Since it still holds @@ -443,9 +445,6 @@ void Client::moveClient(Client&& other) // time so that the Client reference can be updated to this Client and no longer be pointing to a moved-from Client. if (other.mImpl->mNetworkUpdateThread) { - // Cancel this Client's network update if one exists. - cancelScheduledNetworkUpdate(); - // Cancel the update. other.cancelScheduledNetworkUpdate();