From eaaf6041b911a77b6cf3f0f85b8af25e1d432c34 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 25 Oct 2011 11:20:42 +0000 Subject: [PATCH] minor fix --- lib/utils/hashdb.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/utils/hashdb.py b/lib/utils/hashdb.py index 20efcef3c..166add957 100644 --- a/lib/utils/hashdb.py +++ b/lib/utils/hashdb.py @@ -30,12 +30,13 @@ class HashDB(object): cursor = property(_get_cursor) - def __del__(self): - self.close() - def close(self): + threadData = getCurrentThreadData() try: - self.cursor.connection.close() + if threadData.hashDBCursor: + threadData.hashDBCursor.close() + threadData.hashDBCursor.connection.close() + threadData.hashDBCursor = None except: pass