Fix Win32Thread trampoline since last commit

In e974d1d2b1 we added the forward, and
that will of course cause us to capture references instead of moved
functions again.
This commit is contained in:
Robbert van der Helm
2021-05-17 01:31:16 +02:00
parent e974d1d2b1
commit 09c2ed96ad
+4 -4
View File
@@ -80,7 +80,7 @@ class Win32Thread {
* @param parameter The parameter passed to the entry point function.
*/
template <typename Function, typename... Args>
Win32Thread(Function&& fn, Args&&... args)
Win32Thread(Function fn, Args... args)
: handle(CreateThread(
nullptr,
0,
@@ -92,9 +92,9 @@ class Win32Thread {
// arguments to the lambda so we don't end up with dangling
// references.
new fu2::unique_function<void()>(
[f = std::forward<Function>(fn),
... args = std::forward<Args>(args)]() mutable {
f(std::forward<Args>(args)...);
[f = std::move(fn),
... args = std::move(args)]() mutable {
f(std::move(args)...);
}),
0,
nullptr),