Only remove an entry from specs when no holders remain
This commit is contained in:
parent
f1672cc695
commit
9f20b36bfc
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue