[*] Amend FileStream::Close (232a136b
)
This commit is contained in:
parent
ec44cc1d69
commit
263ca6e646
@ -397,7 +397,6 @@ namespace Aurora::IO::FS
|
||||
bool bDeleteFailed {};
|
||||
AuString path;
|
||||
|
||||
|
||||
if ((hHandle != INVALID_HANDLE_VALUE) &&
|
||||
(this->bShouldDelete))
|
||||
{
|
||||
|
@ -255,18 +255,22 @@ namespace Aurora::IO::FS
|
||||
|
||||
void PosixFileStream::Close()
|
||||
{
|
||||
AU_DEBUG_MEMCRUNCH;
|
||||
AU_LOCK_GUARD(this->mutex_);
|
||||
AuString path;
|
||||
|
||||
if (AuExchange(this->bMadeTemporary, false) &&
|
||||
this->pHandle_)
|
||||
{
|
||||
path = this->pHandle_->GetPath();
|
||||
}
|
||||
|
||||
auto pHandle = this->pHandle_;
|
||||
AuResetMember(this->pHandle_);
|
||||
|
||||
if (AuExchange(this->bMadeTemporary, false))
|
||||
if (path.size())
|
||||
{
|
||||
Aurora::RuntimeWaitForSecondaryTick();
|
||||
if (pHandle)
|
||||
{
|
||||
PosixUnlink(pHandle->GetPath().c_str());
|
||||
}
|
||||
PosixUnlink(path.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user