Skip to content

Commit b64b41b

Browse files
committed
Fix leak in TypeInfo.CreateTupleDescriptor
1 parent 232e090 commit b64b41b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Orm/Xtensive.Orm/Orm/Model/TypeInfo.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2007-2020 Xtensive LLC.
1+
// Copyright (C) 2007-2022 Xtensive LLC.
22
// This code is distributed under MIT license terms.
33
// See the License.txt file in the project root for more information.
44
// Created by: Dmitri Maximov
@@ -38,7 +38,7 @@ public sealed class TypeInfo : SchemaMappedNode
3838
/// </summary>
3939
public const int MinTypeId = 100;
4040

41-
private ColumnInfoCollection columns;
41+
private readonly ColumnInfoCollection columns;
4242
private readonly FieldMap fieldMap;
4343
private readonly FieldInfoCollection fields;
4444
private readonly TypeIndexInfoCollection indexes;
@@ -747,8 +747,8 @@ private bool GetIsLeaf()
747747

748748
private void CreateTupleDescriptor()
749749
{
750-
var orderedColumns = columns.OrderBy(c => c.Field.MappingInfo.Offset);
751-
columns = new ColumnInfoCollection(this, "Columns");
750+
var orderedColumns = columns.OrderBy(c => c.Field.MappingInfo.Offset).ToList();
751+
columns.Clear();
752752
columns.AddRange(orderedColumns);
753753
TupleDescriptor = TupleDescriptor.Create(
754754
Columns.Select(c => c.ValueType).ToArray(Columns.Count));

0 commit comments

Comments
 (0)