Free the object creation info on destruction
This commit is contained in:
parent
b7aabd7860
commit
3bd5dc011c
|
@ -39,6 +39,13 @@ XObject::~XObject() {
|
||||||
|
|
||||||
if (allocated_guest_object_) {
|
if (allocated_guest_object_) {
|
||||||
uint32_t ptr = guest_object_ptr_ - sizeof(X_OBJECT_HEADER);
|
uint32_t ptr = guest_object_ptr_ - sizeof(X_OBJECT_HEADER);
|
||||||
|
auto header = memory()->TranslateVirtual<X_OBJECT_HEADER*>(ptr);
|
||||||
|
|
||||||
|
// Free the object creation info
|
||||||
|
if (header->object_create_info) {
|
||||||
|
memory()->SystemHeapFree(header->object_create_info);
|
||||||
|
}
|
||||||
|
|
||||||
memory()->SystemHeapFree(ptr);
|
memory()->SystemHeapFree(ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue