ソースを参照

remove Activator.CreateInstance to get size

Bert Temme 2 年 前
コミット
187e405b37
1 ファイル変更1 行追加1 行削除
  1. 1 1
      src/SharpGLTF.Cesium/BinaryTable.cs

+ 1 - 1
src/SharpGLTF.Cesium/BinaryTable.cs

@@ -201,7 +201,7 @@ namespace SharpGLTF
             Guard.IsTrue(isValueType, nameof(T), "T must be a value type");
 
             var type = typeof(T);
-            int size = Marshal.SizeOf(Activator.CreateInstance(type));
+            var size = Marshal.SizeOf<T>();
             return size;
         }
     }