USB: Add asserts under KDEBUG that IDs being put have no remaining children.

Change-Id: I100828d2724d65ab0841e1262c7db7e144b56aab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4441
This commit is contained in:
Augustin Cavalier
2021-09-16 13:17:34 -04:00
parent 838251124c
commit ad56cbbb6e
@@ -197,6 +197,18 @@ Stack::PutUSBID(Object *object)
}
fObjectArray[id] = NULL;
#if KDEBUG
// Validate that no children of this object are still in the stack.
for (usb_id i = 0; i < fObjectMaxCount; i++) {
if (fObjectArray[i] == NULL)
continue;
ASSERT_PRINT(fObjectArray[i]->Parent() != object,
"%s", fObjectArray[i]->TypeName());
}
#endif
Unlock();
}