From 6193a4683199597388c842896562c3e427157c55 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 7 Feb 2014 11:28:45 +0100 Subject: [PATCH] Call getBound before unref on p_action. --- src/surf/vm_workstation_hl13.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/surf/vm_workstation_hl13.cpp b/src/surf/vm_workstation_hl13.cpp index 1be5053ade..a0b0b75798 100644 --- a/src/surf/vm_workstation_hl13.cpp +++ b/src/surf/vm_workstation_hl13.cpp @@ -432,9 +432,6 @@ void WorkstationVMHL13::migrate(surf_resource_t ind_dst_pm) if (p_action->getRemainsNoUpdate() > 0) XBT_CRITICAL("FIXME: need copy the state(?), %f", p_action->getRemainsNoUpdate()); - int ret = p_action->unref(); - xbt_assert(ret == 1, "Bug: some resource still remains"); - /* keep the bound value of the cpu action of the VM. */ double old_bound = p_action->getBound(); if (old_bound != 0) { @@ -442,6 +439,9 @@ void WorkstationVMHL13::migrate(surf_resource_t ind_dst_pm) new_cpu_action->setBound(old_bound); } + int ret = p_action->unref(); + xbt_assert(ret == 1, "Bug: some resource still remains"); + p_action = new_cpu_action; } -- 2.20.1