Re: Help with a memory leak
- From: Nicholas Sherlock <n_sherlock@xxxxxxxxxxx>
- Date: Wed, 30 Nov 2005 22:47:25 +1300
salenetus@xxxxxxxxx wrote:
Anyways, I create in this thread a couple of componets like MailPop := TIdPOP3.Create(Nil);
First question. IS the bit where I am using NIL correct or should it be something else? And if so, how do I know what it should be?
Yes, this is correct. This creates these components with no owner so you have to free them manually.
to get rid of the bits and pices. However, each time my thread exits, I was expecting some memory used when the thread was created, to be returned to the system but it doesn't seem to. It looks as though it uses a bit more each time without returning any at the end.
You're correct, the thread does need to be freed at some point. If you don't need to access your thread's data after it finishes, set FreeOnTerminate. You can also free your thread from the OnTerminate handler.
Cheers, Nicholas Sherlock .
- Follow-Ups:
- Re: Help with a memory leak
- From: salenetus
- Re: Help with a memory leak
- References:
- Help with a memory leak
- From: salenetus
- Help with a memory leak
- Prev by Date: Help with a memory leak
- Next by Date: Re: Help with a memory leak
- Previous by thread: Help with a memory leak
- Next by thread: Re: Help with a memory leak
- Index(es):
Relevant Pages
|
|