I have a client-server application developed in Delphi (XE2) which uses Data Abstract and RemObjects SDK (V.8.3.93.1183)
Every thing works fine except this memory leak. Every time i close the project i get this message. I’ve searched the entire project, and i could’n find the leak source. (DataParameterArray is never created ).
I can’t reproduce this case with our samples.
can you create a simple testcase that reproduces this issue, pls?
you can attach it here or send directly to support.
this isn’t a bug.
your testcase has aOutputParameters parameter of TRORemoteCommand that is leaked.
You need to free output parameters of TRORemoteCommand manually.
I tried to free the parameters using this method but i get an Exception “Invalid pointer operation”
var
id: integer;
CustomerID: string;
ParamArray:DataParameterArray;
begin
ClientDataModule.cmd.Execute('delete',['id','CustomerID'],[id,CustomerID]);
ParamArray := DataParameterArray(ClientDataModule.cmd.ExecuteCall.Params.FindParam(ClientDataModule.cmd.ExecuteCall.Outgoing ParametersParameter).AsComplexType);
ParamArray.Free;
end
procedure TClientForm.btn1Click(Sender: TObject);
var
id: string;
begin
id := ClientDataModule.tbl_Customers.FieldByName('id').Value;
ClientDataModule.cmd.Execute('delete',['id'],[id]);
ClientDataModule.cmd.ExecuteCall.ParamByName('aOutputParameters').AsComplexType.Free;
ClientDataModule.tbl_Customers.Refresh;
end;