Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
More template based factorization
[simgrid.git] / src / smpi / smpi_datatype.cpp
index 5d39365..d024277 100644 (file)
@@ -159,18 +159,7 @@ Datatype::~Datatype(){
       return;
   }
 
-  if(!attributes_.empty()){
-    int flag;
-    for(auto it = attributes_.begin(); it != attributes_.end(); it++){
-      try{
-        smpi_key_elem elem = keyvals_.at((*it).first);
-        if (elem != nullptr && elem->delete_fn.type_delete_fn != nullptr)
-          elem->delete_fn.type_delete_fn(this, (*it).first, (*it).second, &flag);
-      }catch(const std::out_of_range& oor) {
-        //already deleted, not a problem;
-      }
-    }
-  }
+  cleanup_attr<Datatype>();
 
   xbt_free(name_);
 }