[tasque/transition: 91/213] Make NativeApplication IDisposable



commit 214af9e37294bebe43a26b7d8e6b99a6f011477d
Author: Antonius Riha <antoniusriha gmail com>
Date:   Wed Aug 15 09:26:14 2012 +0200

    Make NativeApplication IDisposable

 src/libtasque/NativeApplication.cs |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/src/libtasque/NativeApplication.cs b/src/libtasque/NativeApplication.cs
index ff36840..66544a8 100644
--- a/src/libtasque/NativeApplication.cs
+++ b/src/libtasque/NativeApplication.cs
@@ -23,14 +23,13 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
-
 using System;
 using System.Diagnostics;
 
 namespace Tasque
 {
-	public abstract class NativeApplication : INativeApplication
-	{
+	public abstract class NativeApplication : IDisposable
+	{		
 		public abstract string ConfDir { get; }
 
 		public void Exit (int exitcode)
@@ -59,6 +58,20 @@ namespace Tasque
 		public abstract void StartMainLoop ();
 
 		public event EventHandler Exiting;
+
+		#region IDisposable implementation
+		public void Dispose ()
+		{
+			Dispose (true);
+			GC.SuppressFinalize (this);
+		}
+		
+		protected virtual void Dispose (bool disposing) {}
+		
+		~NativeApplication ()
+		{
+			Dispose (false);
+		}
+		#endregion
 	}
 }
-



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