kfdtest: fix resource leakage
Resource allocated in SetUp/HsaNodeInfo::Init,
needs be delete in TearDown/HsaNodeInfo::Delete.
Signed-off-by: James Zhu <James.Zhu@amd.com>
[ROCm/ROCR-Runtime commit: f8d8b8011f]
This commit is contained in:
1 parent
e00c926d27
commit
b42578b070
3 files changed
+9
-1
No files matched your search
@@ -609,13 +609,19 @@ bool HsaNodeInfo::Init(int NumOfNodes) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
HsaNodeInfo::~HsaNodeInfo() {
|
||||
void HsaNodeInfo::Delete() {
|
||||
const HsaNodeProperties *nodeProperties;
|
||||
|
||||
for (unsigned int i = 0; i < m_HsaNodeProps.size(); i++)
|
||||
delete m_HsaNodeProps.at(i);
|
||||
|
||||
m_HsaNodeProps.clear();
|
||||
m_NodesWithGPU.clear();
|
||||
m_NodesWithoutGPU.clear();
|
||||
}
|
||||
|
||||
HsaNodeInfo::~HsaNodeInfo() {
|
||||
Delete();
|
||||
}
|
||||
|
||||
const std::vector<int>& HsaNodeInfo::GetNodesWithGPU() const {
|
||||
|
||||
Reference in new issue
Block a user