close nostrdb and disconnect from relays on logout
This was causing crashing and corruption issues. This should have been handled by the garbage collector, but for some reason old references still hang around. Add a "close" method to DamusState which disconnects from relays and closes nostrdb. Changelog-Fixed: Fix crash when logging out and switching accounts Changelog-Fixed: Fix persistent local notifications even after logout Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -176,6 +176,7 @@ class Ndb {
|
||||
}
|
||||
|
||||
func close() {
|
||||
guard !self.closed else { return }
|
||||
self.closed = true
|
||||
ndb_destroy(self.ndb.ndb)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user