![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Нужно ли вызывать Free
DelphiLexx © (2005-10-28 19:44:00)У меня есть control№1 на нем control№2 т.е. control№2.parent = control№1.
Вопрос:
Я вызываю control№1.Free нужно ли перед этим вызывать control№2.Free.
tesseract (2005-10-28 20:48:00) [1]> to begin..end
Судя по всему зависит от версии Delphi
Джо (2005-10-28 20:22:00) [2]Из Справки по TControl.Parent:
The Parent property declared in TControl is similar to the Owner property declared in TComponent, in that the Parent of a control frees the control just as the Owner of a component frees that Component.
Джо (2005-10-28 20:22:00) [3]
> [4] begin...end © (28.10.05 20:20)
Ну надо же :-)
begin...end (2005-10-28 20:20:00) [4]> DelphiLexx © (28.10.05 19:44)
> tesseract © (28.10.05 20:09) [2]
The Parent property declared in TControl is similar to the Owner property declared in TComponent, in that the Parent of a control frees the control just as the Owner of a component frees that Component.
DelphiLexx (2005-10-28 20:10:00) [5]
> нужно ли кому?
Мне в программном коде.
Вообще мне кажется вопрос понятен.
tesseract (2005-10-28 20:09:00) [6]
> Я вызываю control№1.Free нужно ли перед этим вызывать control№2.
> Free.
Если компоненты созданы динамически то нужно. И лучше не Free а FreeAndNil.
Автовызов Free в принципе должен вызываться только если control2.Owner=control1.
Reindeer Moss Eater (2005-10-28 19:52:00) [7]нужно ли кому?
нужно ли чему?