Re: Help with a memory leak



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
.



Relevant Pages

  • Re: Pass control back from HTTPModule or HTTPHandler
    ... First question would be to determine why you cant just add a flag in your ... module or handler to control whether the contents of the handler are ... request to another virtual directory, or to lower in the stack where another ...
    (microsoft.public.dotnet.framework.aspnet)
  • uplevel, upvar and the Tcl library
    ... First question: ... How can I make an uplevel from the handler by using the Tcl library? ... returns TCL_ERROR with an error message like: ...
    (comp.lang.tcl)
  • uplevel, upvar and the Tcl library
    ... First question: ... How can I make an uplevel from the handler by using the Tcl library? ... returns TCL_ERROR with an error message like: ...
    (comp.lang.tcl)