Skip to content

Commit 2fa0a88

Browse files
committed
Fix TRACKER issues
Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 4ae8c9d commit 2fa0a88

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/libumf_linux.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ void __attribute__((constructor)) umfCreate(void) {
1919
}
2020

2121
void __attribute__((destructor)) umfDestroy(void) {
22-
umfMemoryTrackerDestroy(TRACKER);
22+
umf_memory_tracker_handle_t t = TRACKER;
23+
TRACKER = NULL;
24+
umfMemoryTrackerDestroy(t);
2325
}
2426

2527
void libumfInit(void) {

src/provider/provider_tracking.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ static umf_result_t umfMemoryTrackerRemove(umf_memory_tracker_handle_t hTracker,
8080

8181
umf_memory_pool_handle_t umfMemoryTrackerGetPool(const void *ptr) {
8282
assert(ptr);
83+
if (TRACKER == NULL) {
84+
return NULL;
85+
}
8386

8487
uintptr_t rkey;
8588
tracker_value_t *rvalue;

0 commit comments

Comments
 (0)