Skip to content

Commit

Permalink
Cancel pending async callback before resetting client and evb
Browse files Browse the repository at this point in the history
  • Loading branch information
yuandagits committed Dec 30, 2024
1 parent 90f941d commit 44f9e55
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ void PeriodicServiceInventoryManager::start() {

void PeriodicServiceInventoryManager::stop() {
stopped_ = true;
// Simply cancel libevent timeout callback before calling reset on the client
// first. This is to ensure that the client is not destroyed while there is a
// pending request.
eventBaseThread_.getEventBase()->timer().cancelAll();
client_.reset();
eventBaseThread_.stop();
}
Expand Down

0 comments on commit 44f9e55

Please sign in to comment.