mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 18:06:32 +08:00
[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:
committed by
Compute-Runtime-Automation
parent
c927c46495
commit
71fe65b327
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user