Skip to content

Commit 39950a1

Browse files
committed
Fix EEE due to GC'ed update delegate on plugin pt. 2
1 parent cf346a5 commit 39950a1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

CollapseLauncher/Classes/Plugins/PluginGameInstallWrapper.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using System;
2020
using System.Collections.Generic;
2121
using System.IO;
22+
using System.Runtime.CompilerServices;
2223
using System.Threading;
2324
using System.Threading.Tasks;
2425

@@ -89,6 +90,7 @@ public void Dispose()
8990
GC.SuppressFinalize(this);
9091
}
9192

93+
[MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]
9294
public async ValueTask<int> GetInstallationPath(bool isHasOnlyMigrateOption = false)
9395
{
9496
// Try get existing path
@@ -191,6 +193,7 @@ public ValueTask<int> StartPackageVerification(List<GameInstallPackage>? gamePac
191193
return new ValueTask<int>(1);
192194
}
193195

196+
[MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]
194197
public async Task StartPackageInstallation()
195198
{
196199
_updateProgressProperty.IsUpdateMode = await GameManager.GetGameState() == GameInstallStateEnum.NeedsUpdate;
@@ -228,6 +231,7 @@ public async Task StartPackageInstallation()
228231
_updateProgressStatusDelegate,
229232
_plugin.RegisterCancelToken(Token.Token),
230233
out nint asyncStartUpdateResult);
234+
231235
routineTask = asyncStartUpdateResult.AsTask();
232236
}
233237
else
@@ -368,6 +372,7 @@ public ValueTask<bool> MoveGameLocation()
368372
return new ValueTask<bool>(false);
369373
}
370374

375+
[MethodImpl(MethodImplOptions.NoOptimization | MethodImplOptions.NoInlining)]
371376
public async ValueTask<bool> UninstallGame()
372377
{
373378
if (!ComMarshal<IGameInstaller>.TryCastComObjectAs(_gameInstaller,

0 commit comments

Comments
 (0)