mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Possible temporary fix against crashes.
This commit is contained in:
parent
a2947fdaaa
commit
8084f9b8f3
6 changed files with 28 additions and 14 deletions
BIN
FFXIVClientStructs.Common.dll
Normal file
BIN
FFXIVClientStructs.Common.dll
Normal file
Binary file not shown.
BIN
FFXIVClientStructs.Generators.dll
Normal file
BIN
FFXIVClientStructs.Generators.dll
Normal file
Binary file not shown.
BIN
FFXIVClientStructs.dll
Normal file
BIN
FFXIVClientStructs.dll
Normal file
Binary file not shown.
|
|
@ -3,6 +3,7 @@ using System.Runtime.InteropServices;
|
|||
using Dalamud.Plugin;
|
||||
using Penumbra.Structs;
|
||||
using Reloaded.Hooks.Definitions.X64;
|
||||
using ResourceHandle = FFXIVClientStructs.FFXIV.Client.System.Resource.Handle.ResourceHandle;
|
||||
|
||||
namespace Penumbra.Interop
|
||||
{
|
||||
|
|
@ -86,9 +87,11 @@ namespace Penumbra.Interop
|
|||
|
||||
for( var i = 0; i < NumResources; i++ )
|
||||
{
|
||||
var handle = ( ResourceHandle* )oldResources[ i ];
|
||||
if( oldResources[ i ].ToPointer() == pResources[ i ] )
|
||||
{
|
||||
PluginLog.Debug( $"Unchanged resource: {ResourceToPath( ( byte* )oldResources[ i ].ToPointer() )}" );
|
||||
( ( ResourceHandle* )oldResources[ i ] )->DecRef();
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -97,6 +100,13 @@ namespace Penumbra.Interop
|
|||
+ $"{ResourceToPath( ( byte* )pResources[ i ] )}" );
|
||||
|
||||
UnloadCharacterResource( oldResources[ i ] );
|
||||
// Temporary fix against crashes?
|
||||
if( handle->RefCount <= 0 )
|
||||
{
|
||||
handle->RefCount = 1;
|
||||
handle->IncRef();
|
||||
handle->RefCount = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,36 +27,31 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ILRepack" Version="2.0.18" GeneratePathProperty="true" />
|
||||
<Reference Include="Dalamud">
|
||||
<HintPath>$(DALAMUD_ROOT)\Dalamud.dll</HintPath>
|
||||
<HintPath>..\libs\Dalamud.dll</HintPath>
|
||||
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\Dalamud.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ImGui.NET">
|
||||
<HintPath>$(DALAMUD_ROOT)\ImGui.NET.dll</HintPath>
|
||||
<HintPath>..\libs\ImGui.NET.dll</HintPath>
|
||||
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\ImGui.NET.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="ImGuiScene">
|
||||
<HintPath>$(DALAMUD_ROOT)\ImGuiScene.dll</HintPath>
|
||||
<HintPath>..\libs\ImGuiScene.dll</HintPath>
|
||||
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\ImGuiScene.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Lumina">
|
||||
<HintPath>$(DALAMUD_ROOT)\Lumina.dll</HintPath>
|
||||
<HintPath>..\libs\Lumina.dll</HintPath>
|
||||
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\Lumina.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Lumina.Excel">
|
||||
<HintPath>$(DALAMUD_ROOT)\Lumina.Excel.dll</HintPath>
|
||||
<HintPath>..\libs\Lumina.Excel.dll</HintPath>
|
||||
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\Lumina.Excel.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="FFXIVClientStructs">
|
||||
<HintPath>..\FFXIVClientStructs.dll</HintPath>
|
||||
<Private>true</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -66,6 +61,14 @@
|
|||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="ILRepack" AfterTargets="Build">
|
||||
<ItemGroup>
|
||||
<InputAssemblies Include="$(TargetPath)"/>
|
||||
<InputAssemblies Include="$(TargetDir)Penumbra.dll $(TargetDir)FFXIVClientStructs.dll" Exclude="$(TargetPath)"/>
|
||||
</ItemGroup>
|
||||
<Exec Command="$(ILRepack) /lib:$(TargetDir) /lib:$(AppData)\XIVLauncher\addon\Hooks\dev /out:$(TargetDir)$(TargetFileName) @(InputAssemblies, ' ')"/>
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="EmbedIO" Version="3.4.3" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
|
|
@ -73,10 +76,10 @@
|
|||
<PackageReference Include="SharpZipLib" Version="1.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Penumbra.API\Penumbra.Api.csproj" />
|
||||
<ProjectReference Include="..\Penumbra.GameData\Penumbra.GameData.csproj" />
|
||||
<ProjectReference Include="..\Penumbra.PlayerWatch\Penumbra.PlayerWatch.csproj" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Penumbra.API\Penumbra.Api.csproj" />
|
||||
<ProjectReference Include="..\Penumbra.GameData\Penumbra.GameData.csproj" />
|
||||
<ProjectReference Include="..\Penumbra.PlayerWatch\Penumbra.PlayerWatch.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ namespace Penumbra
|
|||
|
||||
public void Initialize( DalamudPluginInterface pluginInterface )
|
||||
{
|
||||
FFXIVClientStructs.Resolver.Initialize();
|
||||
PluginInterface = pluginInterface;
|
||||
Service< DalamudPluginInterface >.Set( PluginInterface );
|
||||
GameData.GameData.GetIdentifier( PluginInterface );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue