I have implementation one of the service method like this:
function TMainService.getSomething(): TList;
begin
var aList:TList:=TList.Create;
try
aList.Add('benefname');
aList.Add('beneflocaddress');
Result:=aList;
finally
FreeAndNil(aList);
end;
end;
When I do FreeAndNil(aList); the method response in client side is empty.
Should I do this in this way or without object frees?
The XData free this object alone or I will have memory leak?