Oct 23, 2008 #1 hbez Instructor Mar 25, 2003 49 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 Jun 1, 2001 1,785 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 May 9, 2001 1,694 GB or FreeAndNil(MyObject); www.radbmx.co.uk Upvote 0 Downvote