Revert resource management change. Doesn't work.

This commit is contained in:
Ottermandias 2021-09-05 02:01:23 +02:00
parent fe0445434f
commit 3cd9655263

View file

@ -112,16 +112,12 @@ namespace Penumbra.Interop
UnloadCharacterResource( oldResources[ i ] );
// Easiest way to actually remove a file from the resource manager.
// Not doing this keeps them in memory for some reason,
// and then corrupts the state when entering a loading screen that is not a teleport.
// This increases the references of all loaded files by one temporarily, but there is extra logic for 0-references,
// and they get loaded anew with GetResourceAsync, but this gets redirected and thus the modded resource reference is increased twice.
// Then it reduces the refcount of all reduces by 1 again, but this time for real, so the resource gets ref count -1, leading to problems.
// Temporary fix against crashes?
if( handle->RefCount <= 0 )
{
handle->RefCount = 1;
handle->DecRef();
handle->IncRef();
handle->RefCount = 1;
}
}
}