[banshee] Implement IDisposable in LazyLoadSourceContents



commit 9f83abdd985e0ddab2c9b49afbb26360a21e7eba
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Fri Nov 27 16:30:13 2009 -0800

    Implement IDisposable in LazyLoadSourceContents

 .../Banshee.Sources.Gui/LazyLoadSourceContents.cs  |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/LazyLoadSourceContents.cs b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/LazyLoadSourceContents.cs
index 6c0be7a..d27e81f 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/LazyLoadSourceContents.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/LazyLoadSourceContents.cs
@@ -34,7 +34,7 @@ using Banshee.Sources;
 
 namespace Banshee.Sources.Gui
 {
-    public class LazyLoadSourceContents<T> : ISourceContents where T : ISourceContents
+    public class LazyLoadSourceContents<T> : ISourceContents, IDisposable where T : ISourceContents
     {
         private object [] args;
         private ISourceContents actual_contents;
@@ -57,6 +57,14 @@ namespace Banshee.Sources.Gui
             this.args = args;
         }
 
+        public void Dispose ()
+        {
+            var disposable = actual_contents as IDisposable;
+            if (disposable != null) {
+                disposable.Dispose ();
+            }
+        }
+
         public bool SetSource (ISource source)
         {
             return ActualContents.SetSource (source);



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