mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Small fixes.
This commit is contained in:
parent
fb2f212970
commit
fe0445434f
4 changed files with 10 additions and 4 deletions
Binary file not shown.
|
|
@ -111,12 +111,17 @@ namespace Penumbra.Interop
|
||||||
+ $"{ResourceToPath( ( byte* )pResources[ i ] )}" );
|
+ $"{ResourceToPath( ( byte* )pResources[ i ] )}" );
|
||||||
|
|
||||||
UnloadCharacterResource( oldResources[ i ] );
|
UnloadCharacterResource( oldResources[ i ] );
|
||||||
// Temporary fix against crashes?
|
|
||||||
|
// 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.
|
||||||
if( handle->RefCount <= 0 )
|
if( handle->RefCount <= 0 )
|
||||||
{
|
{
|
||||||
handle->RefCount = 1;
|
handle->RefCount = 1;
|
||||||
handle->IncRef();
|
handle->DecRef();
|
||||||
handle->RefCount = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -171,7 +171,7 @@ namespace Penumbra.UI
|
||||||
.GetField( "_changedSettings", BindingFlags.Instance | BindingFlags.NonPublic )
|
.GetField( "_changedSettings", BindingFlags.Instance | BindingFlags.NonPublic )
|
||||||
?.GetValue( _penumbra.ObjectReloader );
|
?.GetValue( _penumbra.ObjectReloader );
|
||||||
|
|
||||||
var currentObjectId = ( int? )_penumbra.ObjectReloader.GetType()
|
var currentObjectId = ( uint? )_penumbra.ObjectReloader.GetType()
|
||||||
.GetField( "_currentObjectId", BindingFlags.Instance | BindingFlags.NonPublic )
|
.GetField( "_currentObjectId", BindingFlags.Instance | BindingFlags.NonPublic )
|
||||||
?.GetValue( _penumbra.ObjectReloader );
|
?.GetValue( _penumbra.ObjectReloader );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -115,6 +115,7 @@ namespace Penumbra.UI
|
||||||
{
|
{
|
||||||
_config.IsEnabled = enabled;
|
_config.IsEnabled = enabled;
|
||||||
_configChanged = true;
|
_configChanged = true;
|
||||||
|
Service<ResidentResources>.Get().ReloadPlayerResources();
|
||||||
_base._penumbra.ObjectReloader.RedrawAll( enabled ? RedrawType.WithSettings : RedrawType.WithoutSettings );
|
_base._penumbra.ObjectReloader.RedrawAll( enabled ? RedrawType.WithSettings : RedrawType.WithoutSettings );
|
||||||
if( _config.EnablePlayerWatch )
|
if( _config.EnablePlayerWatch )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue