[smuxi] Engine: implemented SqliteMessageBuffer.Dispose()



commit eae88376d22f1f88bcc46581e5cc5591c50c3210
Author: Mirco Bauer <meebey meebey net>
Date:   Wed Feb 26 22:46:01 2014 +0100

    Engine: implemented SqliteMessageBuffer.Dispose()

 src/Engine/MessageBuffers/SqliteMessageBuffer.cs |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/Engine/MessageBuffers/SqliteMessageBuffer.cs 
b/src/Engine/MessageBuffers/SqliteMessageBuffer.cs
index 44210ad..ddc2a62 100644
--- a/src/Engine/MessageBuffers/SqliteMessageBuffer.cs
+++ b/src/Engine/MessageBuffers/SqliteMessageBuffer.cs
@@ -197,7 +197,16 @@ namespace Smuxi.Engine
 
         public override void Dispose()
         {
+            var connection = Connection;
+            if (connection == null) {
+                return;
+            }
+
             Flush();
+            Connection = null;
+
+            connection.Close();
+            connection.Dispose();
         }
     }
 }


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