Skip to content

Commit

Permalink
Refs #14737: Disable periodic HB event before deinit
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com>
  • Loading branch information
EduPonz committed Jun 1, 2022
1 parent 2e573d4 commit 5ae31c9
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/cpp/rtps/writer/StatefulWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,13 @@ StatefulWriter::~StatefulWriter()
nack_response_event_ = nullptr;
}

// This must be the next action, because free CacheChange_t from async thread.
if (periodic_hb_event_ != nullptr)
{
delete(periodic_hb_event_);
periodic_hb_event_ = nullptr;
}

// This must be the next action, as it frees CacheChange_t from the async thread.
deinit();

// Stop all active proxies and pass them to the pool
Expand Down Expand Up @@ -354,13 +360,6 @@ StatefulWriter::~StatefulWriter()
}
}

// Destroy heartbeat event
if (periodic_hb_event_ != nullptr)
{
delete(periodic_hb_event_);
periodic_hb_event_ = nullptr;
}

// Delete all proxies in the pool
for (ReaderProxy* remote_reader : matched_readers_pool_)
{
Expand Down

0 comments on commit 5ae31c9

Please sign in to comment.