So that it can used for cleanup before we've a file_stream. Note this also gets rid of the weird double initialization of the local stream variable. Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx> --- gtk/channel-main.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gtk/channel-main.c b/gtk/channel-main.c index 1b314ac..cd5b162 100644 --- a/gtk/channel-main.c +++ b/gtk/channel-main.c @@ -1530,17 +1530,18 @@ static void file_xfer_close_cb(GObject *object, { GSimpleAsyncResult *res; SpiceFileXferTask *task; - GInputStream *stream = G_INPUT_STREAM(object); GError *error = NULL; - stream = G_INPUT_STREAM(object); task = user_data; - g_input_stream_close_finish(stream, close_res, &error); - if (error) { - /* This error dont need to report to user, just print a log */ - SPICE_DEBUG("close file error: %s", error->message); - g_clear_error(&error); + if (object) { + GInputStream *stream = G_INPUT_STREAM(object); + g_input_stream_close_finish(stream, close_res, &error); + if (error) { + /* This error dont need to report to user, just print a log */ + SPICE_DEBUG("close file error: %s", error->message); + g_clear_error(&error); + } } /* Notify to user that files have been transferred or something error -- 1.8.1.4 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel