What is the bug?
I think I've found a memory leak issue in the AvroConvert.SerializeHeadless functions
Fill up the section or provide code
Why the MemoryStream does not uses 'using' here, while it is used in the static byte[] Serialize(object obj, CodecType codecType) function?
public static partial class AvroConvert {
/// <summary>
/// Serializes given object to Avro format - <c>excluding</c> header
/// </summary>
public static byte[] SerializeHeadless(object obj, string schema)
{
MemoryStream resultStream = new MemoryStream(); // Why there is no use of using here?
var encoder = new Writer(resultStream);
var schemaObject = Schema.Create(schema);
var resolver = new WriteResolver();
var writer = resolver.ResolveWriter(schemaObject);
writer(obj, encoder);
var result = resultStream.ToArray();
return result;
}
What is the bug? I think I've found a memory leak issue in the AvroConvert.SerializeHeadless functions
Fill up the section or provide code
Why the MemoryStream does not uses 'using' here, while it is used in the static byte[] Serialize(object obj, CodecType codecType) function?
Yours, Gerome