The expected use case can't really be tested, but it works in Windows if a heap is dec'd to refcount 0 and then a new resource is placed on it.
I changed the implementation to use a resource count because it doesn't break when the refcount is checked by bumping to 1 and releasing to 0.