fix mancata chiusura db

This commit is contained in:
mac12m99
2021-02-04 21:24:35 +01:00
parent 213a573d10
commit 0952f63584
3 changed files with 10 additions and 2 deletions
+4
View File
@@ -24,6 +24,10 @@ class nested_dict_sqlite(defaultdict):
self[key] = value = self.default_factory(key)
return value
def close(self):
for key in self.keys():
self[key].close()
db_name = filetools.join(config.get_data_path(), "db.sqlite")
db = nested_dict_sqlite(lambda table: SqliteDict(db_name, table, 'c', True))