[Spice-devel] [PATCH spice-gtk] windows: initialize co->ret to not randomly release fiber

Christophe Fergeau cfergeau at redhat.com
Thu Dec 15 01:13:21 PST 2011


Hey,

When is it triggered exactly? On reconnect? The coroutine structure is
stored in SpiceChannelPrivate which means it's initially 0'ed out, and this
should be 0 when coroutine_init is first called. If this co->ret = 0; is
there to handle subsequent calls to coroutine_init, it might be better to
memset the whole struct coroutine on disconnect (or whatever place is
appropriate), or to do 0 out the whole structure first thing in all the
coroutine implementations.

Dunno if that makes sense or if I missed something though :)

Christophe

On Wed, Dec 14, 2011 at 09:59:01PM +0100, Marc-André Lureau wrote:
> ---
>  gtk/coroutine_winfibers.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/gtk/coroutine_winfibers.c b/gtk/coroutine_winfibers.c
> index a22da3b..a4cd14b 100644
> --- a/gtk/coroutine_winfibers.c
> +++ b/gtk/coroutine_winfibers.c
> @@ -60,6 +60,7 @@ int coroutine_init(struct coroutine *co)
>  	}
>  
>  	co->fiber = CreateFiber(0, &coroutine_trampoline, co);
> +	co->ret = 0;
>  	if (co->fiber == NULL)
>  		return -1;
>  
> -- 
> 1.7.7.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20111215/98b2ad89/attachment.pgp>


More information about the Spice-devel mailing list