[Sysman] Replace normal pointers with smart pointers (11/n)

Replacing normal pointers by smart pointers in memory module
of LO sysman(zesinit).

Related-To: LOCI-2810

Signed-off-by: Singh, Prasoon <prasoon.singh@intel.com>
This commit is contained in:
Singh, Prasoon
2023-04-05 10:30:57 +00:00
committed by Compute-Runtime-Automation
parent d1393e08d3
commit afe99d7dbc
12 changed files with 25 additions and 61 deletions

View File

@@ -14,18 +14,12 @@
namespace L0 {
namespace Sysman {
MemoryHandleContext::~MemoryHandleContext() {
for (Memory *pMemory : handleList) {
delete pMemory;
}
}
MemoryHandleContext::~MemoryHandleContext() = default;
void MemoryHandleContext::createHandle(bool onSubdevice, uint32_t subDeviceId) {
Memory *pMemory = new MemoryImp(pOsSysman, onSubdevice, subDeviceId);
std::unique_ptr<Memory> pMemory = std::make_unique<MemoryImp>(pOsSysman, onSubdevice, subDeviceId);
if (pMemory->initSuccess == true) {
handleList.push_back(pMemory);
} else {
delete pMemory;
handleList.push_back(std::move(pMemory));
}
}