8000 Check global state destruction in destructors by npmiller · Pull Request #1296 · oneapi-src/unified-memory-framework · GitHub
[go: up one dir, main page]

Skip to content

Check global state destruction in destructors #1296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/memory_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ static umf_result_t umfPoolCreateInternal(const umf_memory_pool_ops_t *ops,
}

void umfPoolDestroy(umf_memory_pool_handle_t hPool) {
if (umf_ba_global_is_destroyed()) {
return;
}

hPool->ops.finalize(hPool->pool_priv);

umf_memory_provider_handle_t hUpstreamProvider = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/memory_provider.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ umf_result_t umfMemoryProviderCreate(const umf_memory_provider_ops_t *ops,
}

void umfMemoryProviderDestroy(umf_memory_provider_handle_t hProvider) {
if (hProvider) {
if (hProvider && !umf_ba_global_is_destroyed()) {
hProvider->ops.finalize(hProvider->provider_priv);
umf_ba_global_free(hProvider);
}
Expand Down
Loading
0