Cita:
Empezado por lbuelvas
...
Parece que la instrucción es innecesaria porque libera el recurso.
|
Hola Luis.
Al parecer estás acertado sobre el motivo, así está comentado en el ejemplo de la ayuda de Delphi:
Código:
procedure TCustomerInfoModule.CustomerInfoModuleGetImageAction( Sender: TObject; Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
Jpg: TJPEGImage;
S: TMemoryStream;
B: TBitmap;
begin
Jpg := TJPEGImage.Create;
try
B := TBitmap.Create;
try
B.Assign(BioLifeGraphic);
Jpg.Assign(B);
finally
B.Free
end;
S := TMemoryStream.Create;
Jpg.SaveToStream(S);
S.Position := 0;
Response.ContentType := 'image/jpeg';
Response.ContentStream := S;
// do not free the stream because the response
// object will handle that task.
finally
Jpg.Free;
end;
end;
Saludos.