Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[surf] Triggers the destructed callbacks on the full object
[simgrid.git] / src / surf / cpu_interface.cpp
index 0142878..bd28c4d 100644 (file)
@@ -191,8 +191,15 @@ Cpu::Cpu(Model *model, const char *name,
 : Cpu(model, name, core, speedPeak, speedScale, SURF_RESOURCE_ON)
 {}
 
 : Cpu(model, name, core, speedPeak, speedScale, SURF_RESOURCE_ON)
 {}
 
-Cpu::~Cpu(){
+void Cpu::onDie()
+{
   surf_callback_emit(cpuDestructedCallbacks, this);
   surf_callback_emit(cpuDestructedCallbacks, this);
+  Resource::onDie();
+}
+
+Cpu::~Cpu()
+{
+  this->die();
   if (p_constraintCoreId){
     for (int i = 0; i < m_core; i++) {
          xbt_free(p_constraintCoreId[i]);
   if (p_constraintCoreId){
     for (int i = 0; i < m_core; i++) {
          xbt_free(p_constraintCoreId[i]);