I have a webservice created with RemObjects SDK over Delphi XE and a function published that to do his works needs to use com objects (Specifically Ado connection to database using DMO). I have detected that when I call this function a lot of times the memory that uses the webservice increases dramatically.
The cause of the memory leak is that the memory that is reserved for the com objects is not released never.
What I have to do to fix that?
Thanks
Code:
constructor TA.Create;
begin
inherited Create;
oServer := CoSQLServer.Create;
end;
destructor TA.Destroy;
begin
oServer := nil;
end;
Declaration
class function CoSQLServer.Create: _SQLServer;
begin
Result := CreateComObject(CLASS_SQLServer) as _SQLServer;
end;