From 71b6a5d9705951c23178f8ebbf527904b9446fde Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Tue, 26 Apr 2016 21:16:02 +0200 Subject: [PATCH] plug a memleak in VM --- src/surf/vm_hl13.cpp | 3 +++ src/surf/vm_hl13.hpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/surf/vm_hl13.cpp b/src/surf/vm_hl13.cpp index fde670b2df..8d54b3cfa6 100644 --- a/src/surf/vm_hl13.cpp +++ b/src/surf/vm_hl13.cpp @@ -127,6 +127,9 @@ VMHL13::VMHL13(VMModel *model, const char* name, sg_host_t host_PM) XBT_VERB("Create VM(%s)@PM(%s) with %ld mounted disks", name, hostPM_->name().c_str(), xbt_dynar_length(p_storage)); } +VMHL13::~VMHL13() { + delete p_cpu; +} void VMHL13::suspend() { diff --git a/src/surf/vm_hl13.hpp b/src/surf/vm_hl13.hpp index a901656b9d..3bcd9b85c3 100644 --- a/src/surf/vm_hl13.hpp +++ b/src/surf/vm_hl13.hpp @@ -46,7 +46,7 @@ public: class VMHL13 : public VirtualMachine { public: VMHL13(VMModel *model, const char* name, sg_host_t host_PM); - ~VMHL13() {} + ~VMHL13(); void suspend() override; void resume() override; -- 2.20.1