diff options
| author | Stefan Boberg <[email protected]> | 2023-04-27 14:35:38 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-27 14:35:38 +0200 |
| commit | 88b977d78617c31f61f2a51e96b35ceeb7e9db72 (patch) | |
| tree | 23a34aea9319a9f4dd41fbc39a51a783aeba7f0f /zencore/workthreadpool.cpp | |
| parent | bugfixes (#261) (diff) | |
| download | zen-88b977d78617c31f61f2a51e96b35ceeb7e9db72.tar.xz zen-88b977d78617c31f61f2a51e96b35ceeb7e9db72.zip | |
made Ref<> constructor explicit (#262)
This change makes the Ref<> constructor explicit, which can help avoid unnecessary overheads and other accidents
Diffstat (limited to 'zencore/workthreadpool.cpp')
| -rw-r--r-- | zencore/workthreadpool.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zencore/workthreadpool.cpp b/zencore/workthreadpool.cpp index 4291d1581..b4328cdbd 100644 --- a/zencore/workthreadpool.cpp +++ b/zencore/workthreadpool.cpp @@ -45,7 +45,7 @@ WorkerThreadPool::ScheduleWork(Ref<IWork> Work) void WorkerThreadPool::ScheduleWork(std::function<void()>&& Work) { - m_WorkQueue.Enqueue(new detail::LambdaWork(Work)); + m_WorkQueue.Enqueue(Ref<IWork>(new detail::LambdaWork(Work))); } [[nodiscard]] size_t @@ -80,4 +80,4 @@ WorkerThreadPool::WorkerThreadFunction() } while (true); } -} // namespace zen
\ No newline at end of file +} // namespace zen |