WDM: Re-think the way subscription handlers are reclaimed
jaylogue opened this issue · 0 comments
jaylogue commented
The current AbortSubscription method in SubscriptionHandler does one too many things - it aborts the subscription and reset the state of the handler if the refcount is one value (1) and releases the handler back to the pool if it's another (0).
This overloading is confusing, error-prone and causes un-necessary stack winding - calling AbortSubscription to abort a subscription results in aborting the subscription (1), then calling Release which calls AbortSubscription again, this time to handle (2).
This should be re-factored to separate out aborting a subscription, and releasing the handler object back to the pool.
This issue corresponds to WEAV-2367.