Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread .Free on external class
Fri, Sep 4 2015 7:53 AMPermanent Link

Matthew Jones

In EWB 1, I have code that is defined as an external, for the
RemObjects SDK.

external TMyClass = class
public
 constructor Create(chnl: THTTPClientChannel; msg: TJSONMessage;
      strServiceName: string);
 function GetServerStatus ( szClientInfo: String;
      OnGetServerStatusComplete: TOnGetServerStatusCallback;
      OnGetServerStatusError: TOnErrorCallback): Integer;
 property fMessage: TMessage read;
end;

This is in the form private variables:

   m_xService: TMyClass ;


It is created in code using

   m_xService := TMyClass.Create(FChannel, FMessage, 'Svc');

But, in the form destroy I have:

   m_xService.Free;

In EWB 1 it works, but EWB 2 complains that there is no Free() match.
What changed please?

--

Matthew Jones
Fri, Sep 4 2015 5:00 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< In EWB 1 it works, but EWB 2 complains that there is no Free() match. What changed please? >>

Just set the instance to nil:

MyInstance:=nil;

and that will work.  You don't need to call Free on external instances anymore - it was just an artificial requirement.

Tim Young
Elevate Software
www.elevatesoft.com
Image