mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-06 02:36:56 +08:00
Merge pull request #522 from Hinidu/threadsafe-json
Make Json.Deserialize thread-safe in spine-csharp
This commit is contained in:
commit
04124a899a
@ -2,15 +2,9 @@ using System.IO;
|
|||||||
|
|
||||||
namespace Spine {
|
namespace Spine {
|
||||||
public static class Json {
|
public static class Json {
|
||||||
|
|
||||||
static readonly SharpJson.JsonDecoder parser;
|
|
||||||
|
|
||||||
static Json () {
|
|
||||||
parser = new SharpJson.JsonDecoder();
|
|
||||||
parser.parseNumbersAsFloat = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static object Deserialize (TextReader text) {
|
public static object Deserialize (TextReader text) {
|
||||||
|
var parser = new SharpJson.JsonDecoder();
|
||||||
|
parser.parseNumbersAsFloat = true;
|
||||||
return parser.Decode(text.ReadToEnd());
|
return parser.Decode(text.ReadToEnd());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user