using System.Collections.Generic;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
+ using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
using HandBrake.Interop.Interop.EventArgs;
{
try
{
-
- if (HBFunctions.hb_global_init() == -1)
- {
- throw new InvalidOperationException("HB global init failed.");
- }
+ TryInit();
}
catch (Exception e)
{
}
}
+ [HandleProcessCorruptedStateExceptions]
+ static void TryInit()
+ {
+ if (HBFunctions.hb_global_init() == -1)
+ {
+ throw new InvalidOperationException("HB global init failed.");
+ }
+ }
+
/// <summary>
/// Ensures the HB global initialize method has been called.
/// </summary>