Does this need coarser atomicity? Couldn't there be a new subscriber between this check against 0, and the subsequent disposal of the connection?