From da79fe75b4e5756ee5720ffa1bbb0c6e30d0ae03 Mon Sep 17 00:00:00 2001 From: micio Date: Fri, 31 Aug 2018 13:16:40 +0000 Subject: [PATCH] Bazaar/Uniq : fixed lambda parameter passed by std::move git-svn-id: svn://ultimatepp.org/upp/trunk@12209 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- bazaar/Uniq/Posix.cpp | 4 +++- bazaar/Uniq/Windows.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bazaar/Uniq/Posix.cpp b/bazaar/Uniq/Posix.cpp index 1cc588c55..45c7237f5 100644 --- a/bazaar/Uniq/Posix.cpp +++ b/bazaar/Uniq/Posix.cpp @@ -8,8 +8,10 @@ NAMESPACE_UPP bool Uniq::SendCmdLine(int pipe) { char buf[256]; + Vectorv; + v.Clear(); fd_set rfds; struct timeval tv; FD_ZERO(&rfds); @@ -40,7 +42,7 @@ bool Uniq::SendCmdLine(int pipe) } fclose(f); // posts the callback to handle new instance's command line - PostCallback([=, &v]() { WhenInstance(v); } ); + PostCallback([=, v{pick(v)}]() { WhenInstance(v); } ); return true; } diff --git a/bazaar/Uniq/Windows.cpp b/bazaar/Uniq/Windows.cpp index 20fbb8e89..c1c2860ac 100644 --- a/bazaar/Uniq/Windows.cpp +++ b/bazaar/Uniq/Windows.cpp @@ -106,7 +106,7 @@ bool Uniq::SendCmdLine(void) // disconnects from client DisconnectNamedPipe(pipe); - PostCallback([=, &v]() { WhenInstance(v); } ); + PostCallback([=, v{pick(v)}]() { WhenInstance(v); } ); return true; }