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

Replacing normal pointers by smart pointers in fan module of L0 sysman.

Related-To: LOCI-2810

Signed-off-by: Singh, Prasoon <prasoon.singh@intel.com>
This commit is contained in:
Singh, Prasoon
2023-04-05 07:21:42 +00:00
committed by Compute-Runtime-Automation
parent c927c46495
commit 71fe65b327
8 changed files with 20 additions and 32 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2022 Intel Corporation
* Copyright (C) 2020-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -13,18 +13,12 @@
namespace L0 {
FanHandleContext::~FanHandleContext() {
for (Fan *pFan : handleList) {
delete pFan;
}
}
FanHandleContext::~FanHandleContext() = default;
void FanHandleContext::init() {
Fan *pFan = new FanImp(pOsSysman);
std::unique_ptr<Fan> pFan = std::make_unique<FanImp>(pOsSysman);
if (pFan->initSuccess == true) {
handleList.push_back(pFan);
} else {
delete pFan;
handleList.push_back(std::move(pFan));
}
}