Количество сборов delphi TCollection не увеличивается после добавления
У меня есть типы
- TNotifyReply = class (TCollectionItem)
- TNotifyReplylist = class (TOwnedCollection)
NotifyReplylist: = TNotifyReplylist.Create (self, TNotifyReply);
После вызова этой функции (любое количество раз), посчитайте ее еще ноль
function TNotifyReplylist.addItem: TNotifyReply;
begin
Result := inherited Add as TNotifyReply;
OutputDebugString(PAnsiChar('Count > '+ inttostr(count)));
end;
Есть идеи, что здесь происходит?
1 ответ
Решение
Нашел проблему, TNotifyReply.Create был
constructor TNotifyReply.Create(ACollection: TCollection);
begin
inherited Create(Collection);
....
изменился на
inherited Create(ACollection);