[Kernel] Add some useful asserts
This commit is contained in:
parent
8ba6f3fc37
commit
b8ecd11e0e
|
@ -194,6 +194,7 @@ X_STATUS ObjectTable::RemoveHandle(X_HANDLE handle) {
|
||||||
if (entry->object) {
|
if (entry->object) {
|
||||||
auto object = entry->object;
|
auto object = entry->object;
|
||||||
entry->object = nullptr;
|
entry->object = nullptr;
|
||||||
|
assert_zero(entry->handle_ref_count);
|
||||||
entry->handle_ref_count = 0;
|
entry->handle_ref_count = 0;
|
||||||
|
|
||||||
// Walk the object's handles and remove this one.
|
// Walk the object's handles and remove this one.
|
||||||
|
|
|
@ -49,6 +49,7 @@ XObject::XObject(KernelState* kernel_state, Type type)
|
||||||
}
|
}
|
||||||
|
|
||||||
XObject::~XObject() {
|
XObject::~XObject() {
|
||||||
|
assert_true(handles_.empty());
|
||||||
assert_zero(pointer_ref_count_);
|
assert_zero(pointer_ref_count_);
|
||||||
|
|
||||||
if (allocated_guest_object_) {
|
if (allocated_guest_object_) {
|
||||||
|
|
Loading…
Reference in New Issue