diff options
| author | 2021-02-27 11:56:04 -0800 | |
|---|---|---|
| committer | 2021-02-27 11:56:04 -0800 | |
| commit | 51fb0a6f9647ba199da10fe4f018ee36e44e65ba (patch) | |
| tree | 89cd2ad6dfb310587aa546bb7b9847762795f08f /src/core/cpu_manager.h | |
| parent | Merge pull request #5953 from bunnei/memory-refactor-1 (diff) | |
| download | yuzu-51fb0a6f9647ba199da10fe4f018ee36e44e65ba.tar.gz yuzu-51fb0a6f9647ba199da10fe4f018ee36e44e65ba.tar.xz yuzu-51fb0a6f9647ba199da10fe4f018ee36e44e65ba.zip | |
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.
Diffstat (limited to 'src/core/cpu_manager.h')
| -rw-r--r-- | src/core/cpu_manager.h | 2 |
1 files changed, 1 insertions, 1 deletions
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: | |||
| 83 | void RunThread(std::size_t core); | 83 | void RunThread(std::size_t core); |
| 84 | 84 | ||
| 85 | struct CoreData { | 85 | struct CoreData { |
| 86 | std::shared_ptr<Common::Fiber> host_context; | 86 | std::unique_ptr<Common::Fiber> host_context; |
| 87 | std::unique_ptr<Common::Event> enter_barrier; | 87 | std::unique_ptr<Common::Event> enter_barrier; |
| 88 | std::unique_ptr<Common::Event> exit_barrier; | 88 | std::unique_ptr<Common::Event> exit_barrier; |
| 89 | std::atomic<bool> is_running; | 89 | std::atomic<bool> is_running; |