Icon View Thread

The following is the text of the current message along with any replies.
Messages 21 to 25 of 25 total
Thread Freeing component and subsequent Assigned checking
Thu, Feb 18 2016 11:56 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

<< I can check if it is assigned and Free it before creation, but how can it be Freed on form close? >>

Just call Free in the form's OnClose event handler.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Feb 18 2016 11:57 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

<< In the Close event I can say:

Free;

However, I can't put the

Free;
Self := nil; >>

You can't assign to Self.  Instead, use the form variable (if you're only using one instance of the form and the instance is stored in the global form unit's form instance variable):

Free;
MyForm:=nil;

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Feb 18 2016 12:24 PMPermanent Link

Trinione

Tim Young [Elevate Software] wrote:
<< Just call Free in the form's OnClose event handler. >>

SmileIn this case that doesn't work as I call a SlideOut function and in the OnAnimationsComplete event is when I need to do the Free and Nil.

The globals unit crossed my mind after sending in my message earlier also. Thanks, will give it a go.
Thu, Feb 18 2016 4:00 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


<< SmileIn this case that doesn't work as I call a SlideOut function and in the OnAnimationsComplete event is when I need to do the Free and Nil. >>

If you're animating the form, then you probably should just show/hide it instead of trying to constantly create/destroy it.  It's actually *worse* for a browser to have you constantly create/destroy elements, because it can over-tax the garbage collector if you do it enough.

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Feb 19 2016 2:01 AMPermanent Link

Trinione

Tim Young [Elevate Software] wrote:
<< because it can over-tax the garbage collector if you do it enough. >>

Ah! Noted. This actually makes life a tad bit easier.

Thanks.
« Previous PagePage 3 of 3
Jump to Page:  1 2 3
Image