We are attempting to connect with Amazon AWS S3 with the TAmazonConnectionInfo and TAmazonStorageService Demo. The connection works perfectly. We can List Buckets, List Bucket files, and Download and Upload files.... But EureakLog reports a memory leak with the AWS S3 Demo. The original demo by Marko Cantu created the TAmazonStorageService in FormCreate but did not dispose of the TAmazonStorageService in FormDestroy.
After observing the memory leak we set the TAmazonStorageService to nil then freed it in FormDestroy but EurekaLog still reports a memory leak and points to s3Service := TAmazonStorageService.Create(AmazonConnectionInfo1);
Is there something wrong here? Does something else have to be disposed of to prevent the memory leak?
procedure TS3ClientForm.FormCreate(Sender: TObject);
begin
AmazonConnectionInfo1.AccountName := 'XXXXXXXXXXXXXXXXXXXXXX';
AmazonConnectionInfo1.AccountKey := 'KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK';
Caption := AmazonConnectionInfo1.StorageEndpoint;
{ Create an s3Service }
s3Service := TAmazonStorageService.Create(AmazonConnectionInfo1);
end;
procedure TS3ClientForm.FormDestroy(Sender: TObject);
begin
{ Free the s3Service }
s3Service := nil;
s3Service.Free;
end;