minor fix

This commit is contained in:
Miroslav Stampar 2011-10-25 11:20:42 +00:00
parent c1486ed4be
commit eaaf6041b9

View File

@ -30,12 +30,13 @@ class HashDB(object):
cursor = property(_get_cursor) cursor = property(_get_cursor)
def __del__(self):
self.close()
def close(self): def close(self):
threadData = getCurrentThreadData()
try: try:
self.cursor.connection.close() if threadData.hashDBCursor:
threadData.hashDBCursor.close()
threadData.hashDBCursor.connection.close()
threadData.hashDBCursor = None
except: except:
pass pass