Skip to content

Commit

Permalink
Also track ANARILight objects for leak detection
Browse files Browse the repository at this point in the history
  • Loading branch information
johguenther authored and jeffamstutz committed Oct 22, 2024
1 parent 17aba42 commit f389af1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/helium/BaseDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ BaseDevice::~BaseDevice()
reportLeaks(state.objectCounts.worlds, "ANARIWorld");
reportLeaks(state.objectCounts.instances, "ANARIInstance");
reportLeaks(state.objectCounts.groups, "ANARIGroup");
reportLeaks(state.objectCounts.lights, "ANARILight");
reportLeaks(state.objectCounts.surfaces, "ANARISurface");
reportLeaks(state.objectCounts.geometries, "ANARIGeometry");
reportLeaks(state.objectCounts.materials, "ANARIMaterial");
Expand Down
1 change: 1 addition & 0 deletions src/helium/BaseGlobalDeviceState.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ struct BaseGlobalDeviceState
std::atomic<size_t> worlds{0};
std::atomic<size_t> instances{0};
std::atomic<size_t> groups{0};
std::atomic<size_t> lights{0};
std::atomic<size_t> surfaces{0};
std::atomic<size_t> geometries{0};
std::atomic<size_t> materials{0};
Expand Down
6 changes: 6 additions & 0 deletions src/helium/BaseObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ void BaseObject::incrementObjectCount()
case ANARI_GROUP:
s->objectCounts.groups++;
break;
case ANARI_LIGHT:
s->objectCounts.lights++;
break;
case ANARI_SURFACE:
s->objectCounts.surfaces++;
break;
Expand Down Expand Up @@ -200,6 +203,9 @@ void BaseObject::decrementObjectCount()
case ANARI_GROUP:
s->objectCounts.groups--;
break;
case ANARI_LIGHT:
s->objectCounts.lights--;
break;
case ANARI_SURFACE:
s->objectCounts.surfaces--;
break;
Expand Down

0 comments on commit f389af1

Please sign in to comment.