[Spice-devel] [PATCH 02/14] Capture 'cursor' by value

Christophe de Dinechin christophe at dinechin.org
Wed Feb 14 17:52:10 UTC 2018


From: Christophe de Dinechin <dinechin at redhat.com>

We should really not be capturing cursor by reference here,
since that value could be changed by the surrounding loop and sending
the data could some day be made asynchronous.

Signed-off-by: Christophe de Dinechin <dinechin at redhat.com>
---
 src/spice-streaming-agent.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp
index a43a52c..c4c52ef 100644
--- a/src/spice-streaming-agent.cpp
+++ b/src/spice-streaming-agent.cpp
@@ -342,7 +342,7 @@ static void cursor_changes(Display *display, int event_base)
             continue;
 
         last_serial = cursor->cursor_serial;
-        auto fill_cursor = [&](uint32_t *pixels) {
+        auto fill_cursor = [cursor](uint32_t *pixels) {
             for (unsigned i = 0; i < cursor->width * cursor->height; ++i)
                 pixels[i] = cursor->pixels[i];
         };
-- 
2.13.5 (Apple Git-94)



More information about the Spice-devel mailing list