fix Pointer recycle (#346)

This commit is contained in:
LoneRanger 2023-02-07 01:17:10 +08:00 committed by GitHub
parent ea901af217
commit 7f4243ab77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -120,6 +120,7 @@ public:
cout << "堆的树状表示:" << endl; cout << "堆的树状表示:" << endl;
TreeNode *root = vecToTree(maxHeap); TreeNode *root = vecToTree(maxHeap);
PrintUtil::printTree(root); PrintUtil::printTree(root);
freeMemoryTree(root);
} }
}; };

View file

@ -331,5 +331,6 @@ class PrintUtil {
cout << "堆的树状表示:" << endl; cout << "堆的树状表示:" << endl;
TreeNode *root = vecToTree(vec); TreeNode *root = vecToTree(vec);
printTree(root); printTree(root);
freeMemoryTree(root);
} }
}; };