Fix Win32Thread not capturing by move

std::function does not allow non-movable lambdas, so capturing by move
doesn't work there. And the old solution of course has issues with
dangling pointers (but because this is C++ the compiler still thinks
it's A-Ok).
This commit is contained in:
Robbert van der Helm
2020-10-27 22:53:59 +01:00
parent 1a18ea8614
commit eb8d4ae1d8
2 changed files with 24 additions and 29 deletions
+2 -1
View File
@@ -18,7 +18,8 @@
PluginContext::PluginContext() : context(), events_timer(context) {}
uint32_t WINAPI win32_thread_trampoline(std::function<void()>* entry_point) {
uint32_t WINAPI
win32_thread_trampoline(fu2::unique_function<void()>* entry_point) {
(*entry_point)();
delete entry_point;