[Spice-devel] [PATCH spice-gtk 03/16] channel-main: Call g_simple_async_result_is_valid first
Christophe Fergeau
cfergeau at redhat.com
Mon Apr 8 09:07:27 PDT 2013
ACK
On Fri, Mar 29, 2013 at 12:40:15PM +0100, Hans de Goede wrote:
> Call g_simple_async_result_is_valid before using the result.
>
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
> gtk/channel-main.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/gtk/channel-main.c b/gtk/channel-main.c
> index 257ded5..5f981c4 100644
> --- a/gtk/channel-main.c
> +++ b/gtk/channel-main.c
> @@ -866,17 +866,15 @@ static void file_xfer_flush_async(SpiceMainChannel *channel, GCancellable *cance
> static gboolean file_xfer_flush_finish(SpiceMainChannel *channel, GAsyncResult *result,
> GError **error)
> {
> - GSimpleAsyncResult *simple;
> + GSimpleAsyncResult *simple = (GSimpleAsyncResult *)result;
>
> - simple = (GSimpleAsyncResult *)result;
> + g_return_val_if_fail(g_simple_async_result_is_valid(result,
> + G_OBJECT(channel), file_xfer_flush_async), FALSE);
>
> if (g_simple_async_result_propagate_error(simple, error)) {
> return FALSE;
> }
>
> - g_return_val_if_fail(g_simple_async_result_is_valid(result,
> - G_OBJECT(channel), file_xfer_flush_async), FALSE);
> -
> CHANNEL_DEBUG(channel, "flushed finished!");
> return g_simple_async_result_get_op_res_gboolean(simple);
> }
> --
> 1.8.1.4
>
> _______________________________________________
> 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/20130408/c896877c/attachment-0001.pgp>
More information about the Spice-devel
mailing list