例外の報告をホストとの境界に限り資源確保の失敗は素通しへ戻す

このコミットが含まれているのは:
routersys committed 2026-09-22 15:41:01 +09:00
1 親 6fa812ba9b
コミット 263615fd37
2ファイル変更
+31 -16

検索条件に一致するファイルはありません

+22 -13
ファイルの表示
@@ -1,3 +1,4 @@
using System.ComponentModel;
using System.Numerics;
using ComputeWeave;
using Vortice.Direct2D1;
@@ -303,9 +304,13 @@ internal sealed class InkDispersionEffectProcessor : VideoEffectProcessorBase
_resourceSet = InkDispersionResourceSet.Create(interopDevice, _interopDomain);
_pipeline = InkDispersionPipeline.TryCreate(interopDevice);
}
catch (Exception exception)
catch (Win32Exception)
{
ReleaseInterop();
return null;
}
catch
{
InkDispersionTelemetry.Report(exception);
ReleaseInterop();
throw;
}
@@ -353,9 +358,8 @@ internal sealed class InkDispersionEffectProcessor : VideoEffectProcessorBase
disposer.Collect(output);
return output;
}
catch (Exception exception)
catch
{
InkDispersionTelemetry.Report(exception);
output?.Dispose();
outputTransformOutput?.Dispose();
outputTransform?.Dispose();
@@ -368,17 +372,10 @@ internal sealed class InkDispersionEffectProcessor : VideoEffectProcessorBase
}
protected override void setInput(ID2D1Image? inputImage)
{
_effect?.SetInput(0, inputImage, true);
if (!_hasOutput)
_effect?.SetInput(1, inputImage, true);
}
protected override void ClearEffectChain()
{
try
{
ClearEffectChainCore();
SetInputCore(inputImage);
}
catch (Exception exception)
{
@@ -387,7 +384,14 @@ internal sealed class InkDispersionEffectProcessor : VideoEffectProcessorBase
}
}
private void ClearEffectChainCore()
private void SetInputCore(ID2D1Image? inputImage)
{
_effect?.SetInput(0, inputImage, true);
if (!_hasOutput)
_effect?.SetInput(1, inputImage, true);
}
protected override void ClearEffectChain()
{
_effect?.SetInput(0, null, true);
_effect?.SetInput(1, null, true);
@@ -409,6 +413,11 @@ internal sealed class InkDispersionEffectProcessor : VideoEffectProcessorBase
ReleaseInterop();
}
}
catch (Exception exception)
{
InkDispersionTelemetry.Report(exception);
throw;
}
finally
{
base.Dispose(disposing);
+9 -3
ファイルの表示
@@ -1,3 +1,4 @@
using System.ComponentModel;
using System.Runtime.InteropServices;
using ComputeWeave;
@@ -56,13 +57,18 @@ internal sealed class InkDispersionPipeline : IDisposable
try
{
host = InkDispersionPipelineHost.Create(device, InkDispersionSettings.MaximumPendingSubmissions);
return new InkDispersionPipeline(device, host);
var pipeline = new InkDispersionPipeline(device, host);
host = null;
return pipeline;
}
catch
catch (Win32Exception)
{
return null;
}
finally
{
host?.Dispose();
host?.WaitForDisposal();
return null;
}
}