From 53765facd4d668dd8f1b84e7601c75e867c577e6 Mon Sep 17 00:00:00 2001 From: Luca Salmin <40690017+morgoth990@users.noreply.github.com> Date: Tue, 12 Apr 2022 12:06:06 +0200 Subject: [PATCH] removed JIT dependency Creator war compiling at runtime to generate a Lambda that instantiate an object of type T. Replaced with new T() --- LibTessDotNet/Sources/MeshUtils.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/LibTessDotNet/Sources/MeshUtils.cs b/LibTessDotNet/Sources/MeshUtils.cs index 3a8b219..e56def2 100644 --- a/LibTessDotNet/Sources/MeshUtils.cs +++ b/LibTessDotNet/Sources/MeshUtils.cs @@ -127,8 +127,6 @@ public interface ITypePool { private Queue _pool = new Queue(); - private static readonly Func Creator = Expression.Lambda>(Expression.New(typeof(T))).Compile(); - public object Get() { lock (_pool) @@ -138,7 +136,7 @@ public object Get() return _pool.Dequeue(); } } - return Creator(); + return new T(); } public void Return(object obj)