summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2014-12-31 12:20:48 +0100
committerYuri Kunde Schlesner <yuriks@yuriks.net>2015-01-09 22:43:51 +0100
commitd751de7341029dc8335a6766dcdf5c8dc047f0bc (patch)
tree377af7443462b50731ce8a817efbc6803a2b3d3c
parentMerge pull request #444 from yuriks/handle-reform2 (diff)
downloadyuzu-d751de7341029dc8335a6766dcdf5c8dc047f0bc.tar
yuzu-d751de7341029dc8335a6766dcdf5c8dc047f0bc.tar.gz
yuzu-d751de7341029dc8335a6766dcdf5c8dc047f0bc.tar.bz2
yuzu-d751de7341029dc8335a6766dcdf5c8dc047f0bc.tar.lz
yuzu-d751de7341029dc8335a6766dcdf5c8dc047f0bc.tar.xz
yuzu-d751de7341029dc8335a6766dcdf5c8dc047f0bc.tar.zst
yuzu-d751de7341029dc8335a6766dcdf5c8dc047f0bc.zip
-rw-r--r--src/core/hle/kernel/kernel.cpp3
-rw-r--r--src/core/hle/kernel/kernel.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index a1bc6c5d8..7d40dcbee 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -44,7 +44,8 @@ ResultVal<Handle> HandleTable::Create(Object* obj) {
objects[slot] = obj;
Handle handle = generation | (slot << 15);
- obj->handle = handle;
+ if (obj->handle == INVALID_HANDLE)
+ obj->handle = handle;
return MakeResult<Handle>(handle);
}
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index 31d80c7ac..a35055724 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -52,7 +52,7 @@ class HandleTable;
class Object : NonCopyable {
friend class HandleTable;
- u32 handle;
+ u32 handle = INVALID_HANDLE;
public:
virtual ~Object() {}
Handle GetHandle() const { return handle; }