From 51fb0a6f9647ba199da10fe4f018ee36e44e65ba Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 27 Feb 2021 11:56:04 -0800 Subject: core: Switch to unique_ptr for usage of Common::Fiber. - With using unique_ptr instead of shared_ptr, we have more explicit ownership of the context. - Fixes a memory leak due to circular reference of the shared pointer. --- src/core/cpu_manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/cpu_manager.h') diff --git a/src/core/cpu_manager.h b/src/core/cpu_manager.h index 17420c941..5ea149f1f 100644 --- a/src/core/cpu_manager.h +++ b/src/core/cpu_manager.h @@ -83,7 +83,7 @@ private: void RunThread(std::size_t core); struct CoreData { - std::shared_ptr host_context; + std::unique_ptr host_context; std::unique_ptr enter_barrier; std::unique_ptr exit_barrier; std::atomic is_running; -- cgit v1.2.3