mirror of https://git.suyu.dev/suyu/suyu
Kernel: Don't re-assign object's handle when duplicating one
This commit is contained in:
parent
6ae12424df
commit
d751de7341
|
@ -44,6 +44,7 @@ ResultVal<Handle> HandleTable::Create(Object* obj) {
|
||||||
objects[slot] = obj;
|
objects[slot] = obj;
|
||||||
|
|
||||||
Handle handle = generation | (slot << 15);
|
Handle handle = generation | (slot << 15);
|
||||||
|
if (obj->handle == INVALID_HANDLE)
|
||||||
obj->handle = handle;
|
obj->handle = handle;
|
||||||
return MakeResult<Handle>(handle);
|
return MakeResult<Handle>(handle);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ class HandleTable;
|
||||||
|
|
||||||
class Object : NonCopyable {
|
class Object : NonCopyable {
|
||||||
friend class HandleTable;
|
friend class HandleTable;
|
||||||
u32 handle;
|
u32 handle = INVALID_HANDLE;
|
||||||
public:
|
public:
|
||||||
virtual ~Object() {}
|
virtual ~Object() {}
|
||||||
Handle GetHandle() const { return handle; }
|
Handle GetHandle() const { return handle; }
|
||||||
|
|
Loading…
Reference in New Issue