diff --git a/src/core/hle/service/gsp/gsp_gpu.cpp b/src/core/hle/service/gsp/gsp_gpu.cpp index 7156f3f5c..41de8f561 100644 --- a/src/core/hle/service/gsp/gsp_gpu.cpp +++ b/src/core/hle/service/gsp/gsp_gpu.cpp @@ -362,12 +362,9 @@ void GSP_GPU::UnregisterInterruptRelayQueue(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x14, 0, 0); SessionData* session_data = GetSessionData(ctx.Session()); - session_data->thread_id = 0; session_data->interrupt_event = nullptr; session_data->registered = false; - // TODO(Subv): Reset next_thread_id so that it doesn't go past the maximum of 4. - IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); @@ -768,5 +765,10 @@ SessionData::SessionData() { used_thread_ids[thread_id] = true; } +SessionData::~SessionData() { + // Free the thread id slot so that other sessions can use it. + used_thread_ids[thread_id] = false; +} + } // namespace GSP } // namespace Service diff --git a/src/core/hle/service/gsp/gsp_gpu.h b/src/core/hle/service/gsp/gsp_gpu.h index c057dffc4..55c2343a4 100644 --- a/src/core/hle/service/gsp/gsp_gpu.h +++ b/src/core/hle/service/gsp/gsp_gpu.h @@ -181,6 +181,7 @@ static_assert(sizeof(CommandBuffer) == 0x200, "CommandBuffer struct has incorrec struct SessionData : public Kernel::SessionRequestHandler::SessionDataBase { SessionData(); + ~SessionData(); /// Event triggered when GSP interrupt has been signalled Kernel::SharedPtr interrupt_event;