mirror of
https://github.com/barronwaffles/dwc_network_server_emulator.git
synced 2026-09-13 13:45:25 -05:00
Added method to close sqlite3 connection
This commit is contained in:
@@ -94,7 +94,15 @@ class GamespyDatabase(object):
|
||||
self.conn.row_factory = sqlite3.Row
|
||||
|
||||
#self.initialize_database()
|
||||
|
||||
def __del__(self):
|
||||
self.close()
|
||||
|
||||
def close(self):
|
||||
if self.conn != None:
|
||||
self.conn.close()
|
||||
self.conn = None
|
||||
|
||||
def initialize_database(self):
|
||||
with Transaction(self.conn) as tx:
|
||||
row = tx.queryone("SELECT COUNT(*) FROM sqlite_master WHERE name = 'users' AND type = 'table'")
|
||||
|
||||
Reference in New Issue
Block a user