[Spice-devel,01/10] Use cursor_item_ref()

Submitted by Jonathon Jongsma on Aug. 31, 2016, 4:54 p.m.

Details

Message ID 1472662486-6567-2-git-send-email-jjongsma@redhat.com
State New
Headers show
Series "Backported patches for spice-server refactory (Aug 31)" ( rev: 3 2 1 ) in Spice

Not browsing as part of any series.

Commit Message

Jonathon Jongsma Aug. 31, 2016, 4:54 p.m.
Use the existing function rather than incrementing the ref directly.
---
 server/cursor-channel.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/server/cursor-channel.c b/server/cursor-channel.c
index 1e753c7..cb3aa49 100644
--- a/server/cursor-channel.c
+++ b/server/cursor-channel.c
@@ -141,8 +141,7 @@  static RedPipeItem *new_cursor_pipe_item(RedChannelClient *rcc, void *data, int
 
     red_pipe_item_init_full(&item->base, RED_PIPE_ITEM_TYPE_CURSOR,
                             cursor_pipe_item_free);
-    item->cursor_item = data;
-    item->cursor_item->refs++;
+    item->cursor_item = cursor_item_ref(data);
     return &item->base;
 }
 

Comments

Hi,

On Wed, Aug 31, 2016 at 11:54:37AM -0500, Jonathon Jongsma wrote:
> Use the existing function rather than incrementing the ref directly.
> ---
>  server/cursor-channel.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/server/cursor-channel.c b/server/cursor-channel.c
> index 1e753c7..cb3aa49 100644
> --- a/server/cursor-channel.c
> +++ b/server/cursor-channel.c
> @@ -141,8 +141,7 @@ static RedPipeItem *new_cursor_pipe_item(RedChannelClient *rcc, void *data, int
>  
>      red_pipe_item_init_full(&item->base, RED_PIPE_ITEM_TYPE_CURSOR,
>                              cursor_pipe_item_free);
> -    item->cursor_item = data;
> -    item->cursor_item->refs++;
> +    item->cursor_item = cursor_item_ref(data);
>      return &item->base;

Acked-by: Victor Toso <victortoso@redhat.com>

>  }
>  
> -- 
> 2.7.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel