mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 17:44:35 +03:00
bugfix: missing account close in queue direct send
found while writing new tests for upcoming functionality. the test had an embarrassing workaround for the symptoms...
This commit is contained in:
@ -1059,6 +1059,15 @@ func initAccount(db *bstore.DB) error {
|
||||
})
|
||||
}
|
||||
|
||||
// CheckClosed asserts that the account has a zero reference count. For use in tests.
|
||||
func (a *Account) CheckClosed() {
|
||||
openAccounts.Lock()
|
||||
defer openAccounts.Unlock()
|
||||
if a.nused != 0 {
|
||||
panic(fmt.Sprintf("account still in use, %d refs", a.nused))
|
||||
}
|
||||
}
|
||||
|
||||
// Close reduces the reference count, and closes the database connection when
|
||||
// it was the last user.
|
||||
func (a *Account) Close() error {
|
||||
|
Reference in New Issue
Block a user