Skip to content

Commit

Permalink
[tbb] Fixing TBB memory leak caused by TBB's asynchronous destruction…
Browse files Browse the repository at this point in the history
… of arenas and streams if not explicitly initialized in a context before a ttb::parallel_for.
  • Loading branch information
sherholz-intel committed Dec 7, 2023
1 parent 458aa5f commit 5d47433
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions openpgl/field/SurfaceVolumeField.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ struct SurfaceVolumeField: public ISurfaceVolumeField

void updateField(SampleContainer& samplesSurface, SampleContainer& samplesVolume) override
{
#if TBB_INTERFACE_VERSION < 12010
// we need to initialize the task_scheduler in the context to avoid
// asyncronous deconsrution of the implicit initialized tbb::arenas and tbb::streams
tbb::task_scheduler_init anonymous;
#endif
if(samplesSurface.size() > 0) {
if(!m_surfaceField.isInitialized()) {
m_surfaceField.buildField(samplesSurface);
Expand Down

0 comments on commit 5d47433

Please sign in to comment.