Currently the count manipulated by ref/deref does not fully determine the lifetime of the object - the object is either kept alive if the refcount is non-zero, or if the owner RefCounter is still alive (separately determined). Make the object lifetime simpler by making it purely determined by the RefCount (and as such RefCounter::Count can just become a regular RefCounted). Add a new variable to track the counter value. This patch is a step towards adding a token type that doesn't increment the count (to be able to avoid bogus churn & keep the count accurate).
Created attachment 250216 [details] Fix