mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-04 00:49:02 -06:00 
			
		
		
		
	Kernel: Don't re-assign object's handle when duplicating one
This commit is contained in:
		@@ -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);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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; }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user