Merge branch 'push-mqkulolswxsx' into 'develop'
fix: memory freeing in memory manager See merge request ems/astdm/modeling.dram/dram.sys.5!151
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
* Matthias Jung
|
||||
* Lukas Steiner
|
||||
* Derek Christ
|
||||
* Thomas Zimmermann
|
||||
*/
|
||||
|
||||
#include "MemoryManager.h"
|
||||
@@ -51,8 +52,13 @@ MemoryManager::~MemoryManager()
|
||||
while (!stack.empty())
|
||||
{
|
||||
tlm::tlm_generic_payload* payload = stack.top();
|
||||
if (size != 0)
|
||||
delete[] payload->get_data_ptr();
|
||||
if (storageEnabled)
|
||||
{
|
||||
unsigned char* ptr = payload->get_data_ptr();
|
||||
if (ptr != nullptr) {
|
||||
delete[] ptr;
|
||||
}
|
||||
}
|
||||
|
||||
payload->reset();
|
||||
delete payload;
|
||||
|
||||
Reference in New Issue
Block a user