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

Frediano Ziglio fziglio at redhat.com
Thu Feb 15 05:48:53 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];
>          };

Acked-by: Frediano Ziglio <fziglio at redhat.com>

Frediano


More information about the Spice-devel mailing list