[Spice-devel] [PATCH spice-gtk 03/16] channel-main: Call g_simple_async_result_is_valid first
Hans de Goede
hdegoede at redhat.com
Fri Mar 29 04:40:15 PDT 2013
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
More information about the Spice-devel
mailing list