Free the object creation info on destruction

This commit is contained in:
Dr. Chat 2015-06-12 21:35:49 -05:00
parent b7aabd7860
commit 3bd5dc011c
1 changed files with 7 additions and 0 deletions

View File

@ -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);
} }
} }