rhythmbox r6062 - in trunk: . podcast



Author: jmatthew
Date: Mon Nov 17 07:27:27 2008
New Revision: 6062
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=6062&view=rev

Log:
2008-11-17  Jonathan Matthew  <jonathan d14n org>

	* podcast/rb-podcast-manager.c: (podcast_download_thread):
	Close the streams (and unref them) before emitting the error/complete
	status.  Previously there was a race between the download thread and
	the main loop thread that could cause crashes here.  Also, now we can
	report errors that occur when closing the output stream.
	Fixes #554556.


Modified:
   trunk/ChangeLog
   trunk/podcast/rb-podcast-manager.c

Modified: trunk/podcast/rb-podcast-manager.c
==============================================================================
--- trunk/podcast/rb-podcast-manager.c	(original)
+++ trunk/podcast/rb-podcast-manager.c	Mon Nov 17 07:27:27 2008
@@ -1525,17 +1525,20 @@
 		download_progress (data, downloaded, data->download_size, FALSE);
 	}
 
+	/* close everything */
+	g_input_stream_close (G_INPUT_STREAM (data->in_stream), data->cancel, NULL);
+	g_object_unref (data->in_stream);
+
+	g_output_stream_close (G_OUTPUT_STREAM (data->out_stream), data->cancel, &error);
+	g_object_unref (data->out_stream);
+
 	if (error != NULL) {
 		download_error (data, error);
 	} else {
 		download_progress (data, downloaded, data->download_size, TRUE);
 	}
 
-	/* close everything */
-	g_input_stream_close (G_INPUT_STREAM (data->in_stream), data->cancel, NULL);
-	/* probably should actually care about this.. */
-	g_output_stream_close (G_OUTPUT_STREAM (data->out_stream), data->cancel, NULL);
-
+	rb_debug ("exiting download thread");
 	return NULL;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]