commit 7f3fe7b9d4fe32c9d2086c9e374cfd9b0a4c79a0
Author: Alan McGovern <[email protected]>
Date: Wed Jun 9 16:03:09 2010 +0100
Make GPodBase implement IDisposable for better .NET-like bindings
Signed-off-by: Nathaniel McCallum <[email protected]>
bindings/mono/libgpod-sharp/GPodBase.cs | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/bindings/mono/libgpod-sharp/GPodBase.cs
b/bindings/mono/libgpod-sharp/GPodBase.cs
index 4118122..cb29e77 100644
--- a/bindings/mono/libgpod-sharp/GPodBase.cs
+++ b/bindings/mono/libgpod-sharp/GPodBase.cs
@@ -50,7 +50,7 @@ namespace GPod {
void SetBorrowed(bool borrowed);
}
- public abstract class GPodBase<T> : IGPodBase {
+ public abstract class GPodBase<T> : IGPodBase, IDisposable {
//protected static Dictionary<IntPtr, int> RefCounter = new
RefCounter();
protected static IntPtr DateTimeTotime_t (DateTime time) {
@@ -78,5 +78,10 @@ namespace GPod {
public void SetBorrowed(bool borrowed) { Borrowed = borrowed; }
protected abstract void Destroy();
+ public void Dispose ()
+ {
+ if (!Borrowed)
+ Destroy ();
+ }
}
}
\ No newline at end of file
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2