-Changed serializer to create objects using GetUninitializedObject when deserializing fields

This commit is contained in:
James Newton-King
2012-07-10 22:57:27 +12:00
parent 9d7046bca2
commit cfb2499a35
5 changed files with 97 additions and 4 deletions
@@ -25,6 +25,8 @@
using System;
using System.Reflection;
using System.Runtime.Serialization;
using System.Security;
namespace Newtonsoft.Json.Serialization
{
@@ -114,5 +116,13 @@ namespace Newtonsoft.Json.Serialization
Properties = new JsonPropertyCollection(UnderlyingType);
ConstructorParameters = new JsonPropertyCollection(UnderlyingType);
}
#if !(SILVERLIGHT || NETFX_CORE || PORTABLE)
[SecuritySafeCritical]
internal object GetUninitializedObject()
{
return FormatterServices.GetUninitializedObject(NonNullableUnderlyingType);
}
#endif
}
}