From: Arnaud Giersch Date: Fri, 7 Feb 2014 13:21:22 +0000 (+0100) Subject: Uncomment code, and fix meomry leaks in WorkstationVMHL13. X-Git-Tag: v3_11_beta~71 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/113afa94b27465734a86d185aed9f3a3a246bac2 Uncomment code, and fix meomry leaks in WorkstationVMHL13. --- diff --git a/src/surf/vm_workstation_hl13.cpp b/src/surf/vm_workstation_hl13.cpp index a0b0b75798..d9299c09ed 100644 --- a/src/surf/vm_workstation_hl13.cpp +++ b/src/surf/vm_workstation_hl13.cpp @@ -252,7 +252,7 @@ WorkstationVMHL13::WorkstationVMHL13(WorkstationVMModelPtr model, const char* na * from the VM name, we have to make sure that the system does not call the * free callback for the network resource object. The network resource object * is still used by the physical machine. */ - p_netElm = new RoutingEdgeWrapper(static_cast(xbt_lib_get_or_null(host_lib, sub_ws->getName(), ROUTING_HOST_LEVEL))); + p_netElm = static_cast(xbt_lib_get_or_null(host_lib, sub_ws->getName(), ROUTING_HOST_LEVEL)); xbt_lib_set(host_lib, name, ROUTING_HOST_LEVEL, p_netElm); p_subWs = sub_ws; @@ -297,10 +297,10 @@ WorkstationVMHL13::WorkstationVMHL13(WorkstationVMModelPtr model, const char* na WorkstationVMHL13::~WorkstationVMHL13() { /* ind_phys_workstation equals to smx_host_t */ - // surf_resource_t ind_vm_workstation = xbt_lib_get_elm_or_null(host_lib, getName()); + surf_resource_t ind_vm_workstation = xbt_lib_get_elm_or_null(host_lib, getName()); /* Before clearing the entries in host_lib, we have to pick up resources. */ - // CpuCas01Ptr cpu = static_cast(surf_cpu_resource_priv(ind_vm_workstation)); + CpuCas01Ptr cpu = static_cast(surf_cpu_resource_priv(ind_vm_workstation)); /* We deregister objects from host_lib, without invoking the freeing callback * of each level. @@ -321,15 +321,15 @@ WorkstationVMHL13::~WorkstationVMHL13() xbt_assert(ret == 1, "Bug: some resource still remains"); /* Free the cpu resource of the VM. If using power_trace, we will have to */ - //delete cpu; + delete cpu; /* Free the network resource of the VM. */ - // Nothing has to be done, because net_elmts is just a pointer on the physical one + // Nothing has to be done, because net_elmts is just a pointer on the physical one /* Free the storage resource of the VM. */ // Not relevant yet - /* Free the workstation resource of the VM. */ + /* Free the workstation resource of the VM. */ } void WorkstationVMHL13::updateState(tmgr_trace_event_t /*event_type*/, double /*value*/, double /*date*/) {