diff --git a/media_softlet/agnostic/common/os/mos_oca_rtlog_mgr.cpp b/media_softlet/agnostic/common/os/mos_oca_rtlog_mgr.cpp index 6431eb3fd87..6150a1f3499 100644 --- a/media_softlet/agnostic/common/os/mos_oca_rtlog_mgr.cpp +++ b/media_softlet/agnostic/common/os/mos_oca_rtlog_mgr.cpp @@ -124,13 +124,17 @@ void MosOcaRTLogMgr::UnregisterRes(OsContextNext *osDriverContext) if (!resInterface.osInterface || !resInterface.osInterface->pfnFreeResource) { MOS_SafeFreeMemory(resInterface.ocaRTLogResource); + resInterface.ocaRTLogResource = nullptr; MOS_SafeFreeMemory(resInterface.osInterface); + resInterface.osInterface = nullptr; return; } resInterface.osInterface->pfnFreeResource(resInterface.osInterface, resInterface.ocaRTLogResource); MOS_SafeFreeMemory(resInterface.ocaRTLogResource); + resInterface.ocaRTLogResource = nullptr; Mos_DestroyInterface(resInterface.osInterface); MOS_SafeFreeMemory(resInterface.osInterface); + resInterface.osInterface = nullptr; } MosOcaRTLogMgr::MosOcaRTLogMgr()