summaryrefslogtreecommitdiff
path: root/src/leap/soledad/__init__.py
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-04-30 17:11:38 -0300
committerdrebs <drebs@leap.se>2013-04-30 17:11:38 -0300
commit703223a4f32d762a27ae8bc66cba15eb6be64006 (patch)
treee92762377b7e9ce73d4ce5cd85e382814a66fd61 /src/leap/soledad/__init__.py
parent4ca21f9307bc5c4966dffbef4dc8b7cfca05095f (diff)
Add __del__ to Soledad to ensure db is closed.
Diffstat (limited to 'src/leap/soledad/__init__.py')
-rw-r--r--src/leap/soledad/__init__.py8
1 files changed, 7 insertions, 1 deletions
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.
#