Help with a memory leak
- From: salenetus@xxxxxxxxx
- Date: 30 Nov 2005 00:29:29 -0800
Hi guys.
The main part of my application creates a thread every five minutes
that checks the email and then terminates (well I think it does). I am
not very good at threads so I am open to any offers of help.
Anyways, I create in this thread a couple of componets like
MailPop := TIdPOP3.Create(Nil);
MessageMemo := TStringList.Create;
MailMessage := TIdMessage.Create(Nil);
MailChecker := TTimer.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?
At the end of the thread I use things like
MailPop.Free;
MailPop := nil;
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.
And lastly, should I set freeonterminate to TRUE? I don't use that
statement at all so
it looks like
MailClient := Tmailthread.Create(True);
MailClient.Resume;
Help and ideas most welcome. The app runs for a couple of days and
then seems to grind to a halt....
I use d6 enterprise with no service packs...
Peter
.
- Follow-Ups:
- Re: Help with a memory leak
- From: Nicholas Sherlock
- Re: Help with a memory leak
- Prev by Date: Re: Delephone - what should I use to write a program like this?
- Next by Date: Re: Help with a memory leak
- Previous by thread: Delephone - what should I use to write a program like this?
- Next by thread: Re: Help with a memory leak
- Index(es):