Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
let base class dtor deal with surf action
[simgrid.git] / src / kernel / activity / ActivityImpl.cpp
index a2cdff3..757667b 100644 (file)
@@ -11,6 +11,15 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
+ActivityImpl::~ActivityImpl()
+{
+  if (surf_action_) {
+    surf_action_->unref();
+    XBT_DEBUG("Destroy activity %p", this);
+    surf_action_ = nullptr;
+  }
+}
+
 void ActivityImpl::suspend()
 {
   if (surf_action_ == nullptr)
@@ -29,7 +38,7 @@ void ActivityImpl::resume()
   on_resumed(this);
 }
 
-void ActivityImpl::set_category(std::string category)
+void ActivityImpl::set_category(const std::string& category)
 {
   if (surf_action_)
     surf_action_->set_category(category);