From 703223a4f32d762a27ae8bc66cba15eb6be64006 Mon Sep 17 00:00:00 2001 From: drebs Date: Tue, 30 Apr 2013 17:11:38 -0300 Subject: Add __del__ to Soledad to ensure db is closed. --- src/leap/soledad/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/leap') diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py index 94ebec1a..be8a7054 100644 --- a/src/leap/soledad/__init__.py +++ b/src/leap/soledad/__init__.py @@ -192,7 +192,7 @@ class Soledad(object): raise NoServerUrl() # - # initialization methods + # initialization/destruction methods # def _bootstrap(self): @@ -298,6 +298,12 @@ class Soledad(object): """ self._db.close() + def __del__(self): + """ + Make sure local database is closed when object is destroyed. + """ + self.close() + # # Management of secret for symmetric encryption. # -- cgit v1.2.3