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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user