Fix crash bugs
This commit is contained in:
@ -75,10 +75,11 @@ ResultCode ServerSession::HandleSyncRequest(std::shared_ptr<Thread> thread) {
|
||||
kernel.memory.ReadBlock(*current_process, thread->GetCommandBufferAddress(), cmd_buf.data(),
|
||||
cmd_buf.size() * sizeof(u32));
|
||||
|
||||
Kernel::HLERequestContext context(kernel, SharedFrom(this), thread);
|
||||
context.PopulateFromIncomingCommandBuffer(cmd_buf.data(), current_process);
|
||||
auto context =
|
||||
std::make_shared<Kernel::HLERequestContext>(kernel, SharedFrom(this), thread);
|
||||
context->PopulateFromIncomingCommandBuffer(cmd_buf.data(), current_process);
|
||||
|
||||
hle_handler->HandleSyncRequest(context);
|
||||
hle_handler->HandleSyncRequest(*context);
|
||||
|
||||
ASSERT(thread->status == Kernel::ThreadStatus::Running ||
|
||||
thread->status == Kernel::ThreadStatus::WaitHleEvent);
|
||||
@ -86,7 +87,7 @@ ResultCode ServerSession::HandleSyncRequest(std::shared_ptr<Thread> thread) {
|
||||
// put the thread to sleep then the writing of the command buffer will be deferred to the
|
||||
// wakeup callback.
|
||||
if (thread->status == Kernel::ThreadStatus::Running) {
|
||||
context.WriteToOutgoingCommandBuffer(cmd_buf.data(), *current_process);
|
||||
context->WriteToOutgoingCommandBuffer(cmd_buf.data(), *current_process);
|
||||
kernel.memory.WriteBlock(*current_process, thread->GetCommandBufferAddress(),
|
||||
cmd_buf.data(), cmd_buf.size() * sizeof(u32));
|
||||
}
|
||||
|
Reference in New Issue
Block a user