[Spice-devel] [PATCH spice-gtk] Fix crash when closing while recording
Alon Levy
alevy at redhat.com
Fri Apr 6 00:09:55 PDT 2012
On Fri, Apr 06, 2012 at 04:08:17AM +0200, Marc-André Lureau wrote:
> First notify about disconnection before resetting the channel data.
> An audio recording task might expect the channel to be in a ready
> state otherwise, for example.
>
I'm wondering if this is enough - what if the event emitted causes a
slightly delayed action, shouldn't the responder check for the
liveliness of the channel? Actually I can't figure out a general way to
do that, so maybe there isn't.
ACK
> https://bugzilla.redhat.com/show_bug.cgi?id=810247
> ---
> gtk/spice-channel.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
> index 783b94a..b0f2d4e 100644
> --- a/gtk/spice-channel.c
> +++ b/gtk/spice-channel.c
> @@ -2411,11 +2411,11 @@ static void channel_disconnect(SpiceChannel *channel)
>
> c->has_error = TRUE; /* break the loop */
>
> - spice_channel_reset(channel, FALSE);
> -
> if (c->state == SPICE_CHANNEL_STATE_READY)
> emit_main_context(channel, SPICE_CHANNEL_EVENT, SPICE_CHANNEL_CLOSED);
>
> + spice_channel_reset(channel, FALSE);
> +
> g_return_if_fail(SPICE_IS_CHANNEL(channel));
> c->state = SPICE_CHANNEL_STATE_UNCONNECTED;
> }
> --
> 1.7.7.6
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
More information about the Spice-devel
mailing list