diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp index da7be89994..518b7f125b 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -2316,12 +2316,12 @@ void Runtime::Unload() { mapped_handle_map_.clear(); memory_handle_map_.clear(); + DestroyAgents(); + CloseTools(); AMD::Unload(); - DestroyAgents(); - DestroyDrivers(); thunkLoader_->DestroyThunkInstance();