Title: Message
|
AFAIK
there is no problem executing Self.Free on the following
conditions:
1. The
object does not have an owner
2. The
Self.Free statement is in a static method
3. The
object is not later refered to from the generating program - either the object
is not assigned to a variable or the variable is never accessed after the method
call that results in the Free.
The
real question is why you would want to do this outside a
thread?
Stephen
In
the case of a form override OnClose and set Action to
caFree;.
procedure TMyForm.FormClose(Sender: TObject; var Action:
TCloseAction); begin
Action := caFree;
end;
Stacey
But I want to self Free - ie immediately after
executing its event it frees itself (eg OnClick).
Regards Paul McKenzie Analyst Programmer SMSS
Ltd.
----- Original Message -----
Sent: Thursday, March 18, 2004 4:07
PM
Subject: RE: [DUG] Self Freeing
Explicitly free it when you are done with it (maby add it to a
list?) or set its owner to something valid so when the owner component is
freed the dynamically created component will also be
freed.
Stacey
What is the best way for a dynamically
created component to free itself ?
Regards Paul McKenzie Analyst
Programmer SMSS Ltd.
_______________________________________________ Delphi mailing
list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This communication contains information that is confidential and the copyright of ensynergy Limited or a third party. If you are not the intended recipient of this communication please delete and destroy all copies and telephone ensynergy Limited on +64 9 3551591 immediately. If you are the intended recipient of this communication you should not copy, disclose or distribute this communication without the authority of ensynergy Limited. Any views expressed in this communication are those of the individual sender, except where the sender specifically states them to be the views of ensynergy Limited. Except as required by law, ensynergy Limited does not represent, warrant and/or guarantee that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.
|
_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi