From 3bd5dc011cf2065fb3e9508044f5799db37d7830 Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Fri, 12 Jun 2015 21:35:49 -0500 Subject: [PATCH] Free the object creation info on destruction --- src/xenia/kernel/xobject.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/xenia/kernel/xobject.cc b/src/xenia/kernel/xobject.cc index e65d979e4..077a3e112 100644 --- a/src/xenia/kernel/xobject.cc +++ b/src/xenia/kernel/xobject.cc @@ -39,6 +39,13 @@ XObject::~XObject() { if (allocated_guest_object_) { uint32_t ptr = guest_object_ptr_ - sizeof(X_OBJECT_HEADER); + auto header = memory()->TranslateVirtual(ptr); + + // Free the object creation info + if (header->object_create_info) { + memory()->SystemHeapFree(header->object_create_info); + } + memory()->SystemHeapFree(ptr); } }