WebAPIContrib.Core icon indicating copy to clipboard operation
WebAPIContrib.Core copied to clipboard

Fixed issue where errorHandler in BsonInputFormatter is invoked multitple times

Open pluma9 opened this issue 5 years ago • 0 comments

CreateJsonSerializer() may return a serializer that was previously returned to the pool. This means this serializer's Error event already have a subscriber. If we try to add more subscribers (jsonSerializer.Error += errorHandler;), the errorHandler will be invoked multiple times when the serializer fail to Deserialize. Therefore, we need to remove the subscriber before returning the serializer to the pool.

pluma9 avatar Dec 19 '20 17:12 pluma9