banshee r4907 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.ServiceStack src/Extensions/Banshee.Daap/Banshee.Daap
- From: abock svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r4907 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.ServiceStack src/Extensions/Banshee.Daap/Banshee.Daap
- Date: Sun, 11 Jan 2009 07:58:39 +0000 (UTC)
Author: abock
Date: Sun Jan 11 07:58:39 2009
New Revision: 4907
URL: http://svn.gnome.org/viewvc/banshee?rev=4907&view=rev
Log:
2009-01-11 Aaron Bockover <abock gnome org>
* src/Extensions/Banshee.Daap/Banshee.Daap/DaapService.cs: Add null checks
around the source_map and its children when disposing since it won't be
initialized if dispose is called before delayed initialize (BNC #465159)
* src/Core/Banshee.Services/Banshee.ServiceStack/ServiceManager.cs: As
an extra precaution, wrap all service disposals in an exception handling
block and just report the exception in the log
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/ServiceManager.cs
trunk/banshee/src/Extensions/Banshee.Daap/Banshee.Daap/DaapService.cs
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/ServiceManager.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/ServiceManager.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/ServiceManager.cs Sun Jan 11 07:58:39 2009
@@ -270,8 +270,12 @@
lock (self_mutex) {
while (dispose_services.Count > 0) {
IService service = dispose_services.Pop ();
- ((IDisposable)service).Dispose ();
- Log.DebugFormat ("Service disposed ({0})", service.ServiceName);
+ try {
+ ((IDisposable)service).Dispose ();
+ Log.DebugFormat ("Service disposed ({0})", service.ServiceName);
+ } catch (Exception e) {
+ Log.Exception ("Service disposal ({0}) threw an exception", e);
+ }
}
services.Clear ();
Modified: trunk/banshee/src/Extensions/Banshee.Daap/Banshee.Daap/DaapService.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Daap/Banshee.Daap/DaapService.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.Daap/Banshee.Daap/DaapService.cs Sun Jan 11 07:58:39 2009
@@ -70,17 +70,21 @@
}
// Dispose any remaining child sources
- foreach (KeyValuePair <string, DaapSource> kv in source_map) {
- kv.Value.Disconnect (true);
- kv.Value.Dispose ();
+ if (source_map != null) {
+ foreach (KeyValuePair <string, DaapSource> kv in source_map) {
+ if (kv.Value != null) {
+ kv.Value.Disconnect (true);
+ kv.Value.Dispose ();
+ }
+ }
+
+ source_map.Clear ();
}
if (container != null) {
ServiceManager.SourceManager.RemoveSource (container, true);
container = null;
}
-
- source_map.Clear ();
}
private void OnServiceFound (object o, ServiceArgs args)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]