mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 01:35:20 +08:00
fix(sysman): Replace normal pointers with smart pointers (14/n)
Replacing normal pointers by smart pointers in performance 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
26a2a2829e
commit
531779ffaf
@@ -16,21 +16,13 @@
|
||||
namespace L0 {
|
||||
|
||||
PerformanceHandleContext::~PerformanceHandleContext() {
|
||||
for (auto &pPerformance : handleList) {
|
||||
if (pPerformance) {
|
||||
delete pPerformance;
|
||||
pPerformance = nullptr;
|
||||
}
|
||||
handleList.pop_back();
|
||||
}
|
||||
handleList.clear();
|
||||
}
|
||||
|
||||
void PerformanceHandleContext::createHandle(ze_device_handle_t deviceHandle, zes_engine_type_flag_t domain) {
|
||||
Performance *pPerformance = new PerformanceImp(pOsSysman, deviceHandle, domain);
|
||||
std::unique_ptr<Performance> pPerformance = std::make_unique<PerformanceImp>(pOsSysman, deviceHandle, domain);
|
||||
if (pPerformance->isPerformanceEnabled == true) {
|
||||
handleList.push_back(pPerformance);
|
||||
} else {
|
||||
delete pPerformance;
|
||||
handleList.push_back(std::move(pPerformance));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user