![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
PThread leak [Delphi, Windows]
SuphEr © (2005-05-06 22:59:00)Здрасте!
Моя проблема такова...
Допустим процедура на кнопке:
procedure TForm1.Button1Click(Sender: PObj);
var thMethod: PThread;
begin
thMethod:=NewThread;
thMethod.Free;
end;
Если нажимать на кнопку быстро много раз, то появляются лики в памяти... Как от этого избавиться?
SuphEr (2005-05-09 01:27:00) [1]Very big thanks! All work! =)
Thaddy (2005-05-07 00:13:00) [2]This code is not good:
You should either terminate the thread before calling free, or use NewthreadAutofree createion function.
What happens here is you create a thread (suspended!) and do not even start it. You need to start it at least once for proper release with free.