Only remove an entry from specs when no holders remain

This commit is contained in:
Tony Garnock-Jones 2019-05-03 11:20:12 +01:00
parent 736c9de3dc
commit ed7cf375ad
1 changed files with 4 additions and 4 deletions

View File

@ -93,10 +93,10 @@
localid connid
(lambda (sub)
(define new-holders (hash-remove (subscription-holders sub) connid))
(specs (hash-remove (specs) (subscription-spec sub)))
(subs (if (hash-empty? new-holders)
(hash-remove (subs) localid)
(hash-set (subs) localid (struct-copy subscription sub
(if (hash-empty? new-holders)
(begin (specs (hash-remove (specs) (subscription-spec sub)))
(subs (hash-remove (subs) localid)))
(subs (hash-set (subs) localid (struct-copy subscription sub
[holders new-holders]))))
;; The messages we send depend on (hash-count new-holders):