Close database connection on garbage collection

This commit is contained in:
JonnyWong16 2024-09-04 13:28:54 -07:00
commit ac32297160
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -491,3 +491,7 @@ class MonitorDatabase(object):
result = self.select_single(query="SELECT last_insert_rowid() AS last_id")
if result:
return result.get('last_id', None)
def __del__(self):
# Close the database connection when object is garbage collected
self.connection.close()