Skip to content

Commit

Permalink
Merge pull request #2566 from RossBrunton/ross/asanfix
Browse files Browse the repository at this point in the history
ShadowMemory should increment/decrement device handle
  • Loading branch information
RossBrunton authored Jan 16, 2025
2 parents 45b8e19 + 782a3cf commit 21866c2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/loader/layers/sanitizer/asan/asan_shadow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ namespace asan {

struct ShadowMemory {
ShadowMemory(ur_context_handle_t Context, ur_device_handle_t Device)
: Context(Context), Device(Device) {}
: Context(Context), Device(Device) {
urDeviceRetain(Device);
}

virtual ~ShadowMemory() {}
virtual ~ShadowMemory() { urDeviceRelease(Device); }

virtual ur_result_t Setup() = 0;

Expand Down

0 comments on commit 21866c2

Please sign in to comment.