diff --git a/include/cserver/engine/components.hpp b/include/cserver/engine/components.hpp index 3454218..3c333b0 100644 --- a/include/cserver/engine/components.hpp +++ b/include/cserver/engine/components.hpp @@ -332,7 +332,7 @@ struct ServiceContextBuilder { static constexpr auto Run() -> void { [] (utempl::TypeList...>) { - ServiceContext context; + static ServiceContext context; context.Run(); for(;;) { std::this_thread::sleep_for(std::chrono::minutes(1));