WeakReferenceable: Allow reference counts of either 0 or 1 during destruction.

Same rationale as for BReferenceable.

Fixes a KDL seen on boot by at least one user following prior changes.
This commit is contained in:
Augustin Cavalier 2023-01-31 21:43:09 -05:00
parent 6f7201128c
commit b956691cdd

View File

@ -79,7 +79,7 @@ BWeakReferenceable::BWeakReferenceable()
BWeakReferenceable::~BWeakReferenceable()
{
if (fPointer->UseCount() > 0) {
if (fPointer->UseCount() != 0 && fPointer->UseCount() != 1) {
char message[256];
snprintf(message, sizeof(message), "deleting referenceable object %p with "
"reference count (%" B_PRId32 ")", this, fPointer->UseCount());