summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/handle_table.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-04-04 07:22:36 +0200
committerbunnei <bunneidev@gmail.com>2021-05-06 01:40:50 +0200
commit7ccbdd4d8d3dea7294d2cac38779cceea9745d52 (patch)
tree3106289a5c5a6e4bf50bc09a548c8408aa29fbad /src/core/hle/kernel/handle_table.cpp
parenthle: kernel: Refactor IPC interfaces to not use std::shared_ptr. (diff)
downloadyuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.tar
yuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.tar.gz
yuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.tar.bz2
yuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.tar.lz
yuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.tar.xz
yuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.tar.zst
yuzu-7ccbdd4d8d3dea7294d2cac38779cceea9745d52.zip
Diffstat (limited to 'src/core/hle/kernel/handle_table.cpp')
-rw-r--r--src/core/hle/kernel/handle_table.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/hle/kernel/handle_table.cpp b/src/core/hle/kernel/handle_table.cpp
index 8eec8a3b5..f746c4888 100644
--- a/src/core/hle/kernel/handle_table.cpp
+++ b/src/core/hle/kernel/handle_table.cpp
@@ -100,7 +100,7 @@ ResultCode HandleTable::Add(Handle* out_handle, KAutoObject* obj, u16 type) {
}
ResultVal<Handle> HandleTable::Duplicate(Handle handle) {
- std::shared_ptr<Object> object = GetGeneric(handle);
+ std::shared_ptr<Object> object = SharedFrom(GetGeneric(handle));
if (object == nullptr) {
LOG_ERROR(Kernel, "Tried to duplicate invalid handle: {:08X}", handle);
return ResultInvalidHandle;
@@ -140,17 +140,17 @@ bool HandleTable::IsValid(Handle handle) const {
return slot < table_size && is_object_valid && generations[slot] == generation;
}
-std::shared_ptr<Object> HandleTable::GetGeneric(Handle handle) const {
+Object* HandleTable::GetGeneric(Handle handle) const {
if (handle == CurrentThread) {
- return SharedFrom(kernel.CurrentScheduler()->GetCurrentThread());
+ return (kernel.CurrentScheduler()->GetCurrentThread());
} else if (handle == CurrentProcess) {
- return SharedFrom(kernel.CurrentProcess());
+ return (kernel.CurrentProcess());
}
if (!IsValid(handle)) {
return nullptr;
}
- return objects[GetSlot(handle)];
+ return objects[GetSlot(handle)].get();
}
void HandleTable::Clear() {