diff --git a/onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc b/onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc index e91fda32510dd..69eabe457a14a 100644 --- a/onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc +++ b/onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc @@ -1097,39 +1097,35 @@ Status QnnBackendManager::TerminateQnnLog() { } void QnnBackendManager::ReleaseResources() { - if (!backend_setup_completed_) { - return; - } - auto result = ReleaseContext(); if (Status::OK() != result) { - LOGS_DEFAULT(ERROR) << "Failed to ReleaseContext."; + LOGS_DEFAULT(ERROR) << "Failed to ReleaseContext: " << result.ErrorMessage(); } result = ReleaseProfilehandle(); if (Status::OK() != result) { - LOGS_DEFAULT(ERROR) << "Failed to ReleaseProfilehandle."; + LOGS_DEFAULT(ERROR) << "Failed to ReleaseProfilehandle: " << result.ErrorMessage(); } result = ReleaseDevice(); if (Status::OK() != result) { - LOGS_DEFAULT(ERROR) << "Failed to ReleaseDevice."; + LOGS_DEFAULT(ERROR) << "Failed to ReleaseDevice: " << result.ErrorMessage(); } result = ShutdownBackend(); if (Status::OK() != result) { - LOGS_DEFAULT(ERROR) << "Failed to ShutdownBackend."; + LOGS_DEFAULT(ERROR) << "Failed to ShutdownBackend: " << result.ErrorMessage(); } result = TerminateQnnLog(); if (Status::OK() != result) { - LOGS_DEFAULT(ERROR) << "Failed to TerminateQnnLog."; + LOGS_DEFAULT(ERROR) << "Failed to TerminateQnnLog: " << result.ErrorMessage(); } if (backend_lib_handle_) { result = UnloadLib(backend_lib_handle_); if (Status::OK() != result) { - LOGS_DEFAULT(ERROR) << "Failed to unload backend library."; + LOGS_DEFAULT(ERROR) << "Failed to unload backend library: " << result.ErrorMessage(); } }