Skip to content

Commit

Permalink
Move thread join to finish callback for shutdown
Browse files Browse the repository at this point in the history
- Shutdown is cleaner if we join the cache thread when the other threads
shut down.  Otherwise, the cache thread may keep running up until the
program exits, causing odd behavior.
  • Loading branch information
zthorson committed Aug 16, 2021
1 parent 08b7fb2 commit cf6a492
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/realm_stages/src/tileing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ Tileing::Tileing(const StageSettings::Ptr &stage_set, double rate)

Tileing::~Tileing()
{
if (m_tile_cache)
{
m_tile_cache->requestFinish();
m_tile_cache->join();
}
}

void Tileing::addFrame(const Frame::Ptr &frame)
Expand Down Expand Up @@ -346,9 +341,14 @@ void Tileing::reset()

void Tileing::finishCallback()
{
if (m_tile_cache)
{
m_tile_cache->requestFinish();
m_tile_cache->join();
}

// Trigger savings
saveAll();

}

Frame::Ptr Tileing::getNewFrame()
Expand Down

0 comments on commit cf6a492

Please sign in to comment.