diff --git a/PorygonSharp/UserData/UserData.cs b/PorygonSharp/UserData/UserData.cs index 875753d..81b2e85 100644 --- a/PorygonSharp/UserData/UserData.cs +++ b/PorygonSharp/UserData/UserData.cs @@ -15,6 +15,8 @@ namespace PorygonSharp.UserData public Type Type { get; } private readonly Dictionary _implicitCasts; private readonly Dictionary _explicitCasts; + // ReSharper disable once CollectionNeverQueried.Local + private readonly List _binaryOperations = new List(); private delegate bool IsCastableDelegate(IntPtr scriptType, bool isExplicit); private delegate IntPtr CastDelegate(IntPtr obj, IntPtr scriptType); @@ -216,6 +218,7 @@ namespace PorygonSharp.UserData { var operation = UserDataBinaryOperation.Create(info); AddUserdataBinaryOperation(Id, (byte)kind, operation.Handle); + _binaryOperations.Add(operation); } [DllImport("PorygonLang", EntryPoint = "RegisterUserDataField", CallingConvention = CallingConvention.Cdecl)]