From: Arnaud Giersch Date: Fri, 7 Feb 2014 10:28:45 +0000 (+0100) Subject: Call getBound before unref on p_action. X-Git-Tag: v3_11_beta~74 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6193a4683199597388c842896562c3e427157c55 Call getBound before unref on p_action. --- 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; }