diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_threading.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_threading.cc index 2d7b935bb..32fb144f5 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_threading.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_threading.cc @@ -492,7 +492,7 @@ dword_result_t NtCreateEvent(lpdword_t handle_ptr, } } - XEvent* ev = new XEvent(kernel_state()); + auto ev = object_ref(new XEvent(kernel_state())); ev->Initialize(!event_type, !!initial_state); // obj_attributes may have a name inside of it, if != NULL. @@ -678,7 +678,7 @@ dword_result_t NtCreateMutant(lpdword_t handle_out, } } - XMutant* mutant = new XMutant(kernel_state()); + auto mutant = object_ref(new XMutant(kernel_state())); mutant->Initialize(initial_owner ? true : false); // obj_attributes may have a name inside of it, if != NULL. @@ -751,7 +751,7 @@ SHIM_CALL NtCreateTimer_shim(PPCContext* ppc_context, return; } - XTimer* timer = new XTimer(kernel_state); + auto timer = object_ref(new XTimer(kernel_state)); timer->Initialize(timer_type); // obj_attributes may have a name inside of it, if != NULL.