Oct 23, 2008 #1 hbez Instructor Joined Mar 25, 2003 Messages 49 Location ZA In the public section of Unit2 (no Form) I declare constructor CREATE(Name : string); In Unit1 I need to destroy (free) objects created with this constructor. Can someone please show me how to do that? Many thkx Hannes
In the public section of Unit2 (no Form) I declare constructor CREATE(Name : string); In Unit1 I need to destroy (free) objects created with this constructor. Can someone please show me how to do that? Many thkx Hannes
Oct 23, 2008 1 #2 DjangMan Programmer Joined Jun 1, 2001 Messages 1,787 Location CA When you create an object you will usually call it's .free method. So at some point you have called: MyObject := TSomeObject.Create('Apple'); Then later you will call: MyObject.Free; Upvote 0 Downvote
When you create an object you will usually call it's .free method. So at some point you have called: MyObject := TSomeObject.Create('Apple'); Then later you will call: MyObject.Free;
Oct 27, 2008 #3 LucieLastic Programmer Joined May 9, 2001 Messages 1,694 Location GB or FreeAndNil(MyObject); www.radbmx.co.uk Upvote 0 Downvote