Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make ActorImpl::context_ a std::unique_ptr.
[simgrid.git] / src / simix / ActorImpl.hpp
index 18ee938..785e25b 100644 (file)
@@ -13,6 +13,7 @@
 #include <functional>
 #include <list>
 #include <map>
 #include <functional>
 #include <list>
 #include <map>
+#include <memory>
 
 struct s_smx_process_exit_fun_t {
   std::function<void(bool, void*)> fun;
 
 struct s_smx_process_exit_fun_t {
   std::function<void(bool, void*)> fun;
@@ -59,7 +60,7 @@ public:
   bool has_to_auto_restart() { return auto_restart_; }
   void set_auto_restart(bool autorestart) { auto_restart_ = autorestart; }
 
   bool has_to_auto_restart() { return auto_restart_; }
   void set_auto_restart(bool autorestart) { auto_restart_ = autorestart; }
 
-  context::Context* context_ = nullptr; /* the context (uctx/raw/thread) that executes the user function */
+  std::unique_ptr<context::Context> context_; /* the context (uctx/raw/thread) that executes the user function */
 
   std::exception_ptr exception_;
   bool finished_  = false;
 
   std::exception_ptr exception_;
   bool finished_  = false;