diff --git a/moveit_core/planning_interface/src/planning_interface.cpp b/moveit_core/planning_interface/src/planning_interface.cpp index c3e594c850..8ccd1f5392 100644 --- a/moveit_core/planning_interface/src/planning_interface.cpp +++ b/moveit_core/planning_interface/src/planning_interface.cpp @@ -53,10 +53,10 @@ struct ActiveContexts std::set contexts_; }; -ActiveContexts& getActiveContexts() +static ActiveContexts& getActiveContexts() { - ActiveContexts ac; - return ac; + static ActiveContexts s_ac; + return s_ac; } } // namespace