mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-24 22:43:47 +00:00
Close handle if valid for move assignment
This commit is contained in:
parent
8a724eb772
commit
8f7ec42c09
@ -45,6 +45,8 @@ namespace Platform::File {
|
||||
ScopedHandle& operator=(const ScopedHandle& other) = delete;
|
||||
ScopedHandle& operator=(ScopedHandle&& other) noexcept
|
||||
{
|
||||
if (mHandle != Handle::Invalid)
|
||||
close(mHandle);
|
||||
mHandle = other.mHandle;
|
||||
other.mHandle = Handle::Invalid;
|
||||
return *this;
|
||||
|
Loading…
x
Reference in New Issue
Block a user