From 88b977d78617c31f61f2a51e96b35ceeb7e9db72 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Thu, 27 Apr 2023 14:35:38 +0200 Subject: made Ref<> constructor explicit (#262) This change makes the Ref<> constructor explicit, which can help avoid unnecessary overheads and other accidents --- zencore/workthreadpool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'zencore/workthreadpool.cpp') 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 Work) void WorkerThreadPool::ScheduleWork(std::function&& Work) { - m_WorkQueue.Enqueue(new detail::LambdaWork(Work)); + m_WorkQueue.Enqueue(Ref(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 -- cgit v1.2.3