Ver Mensaje Individual
  #1  
Antiguo 15-12-2019
jocaro jocaro is offline
Miembro
 
Registrado: sep 2011
Posts: 104
Reputación: 13
jocaro Va por buen camino
Redimensionar matriz de TRecords con Streams

Hola, les planteo una duda

En un TRecord defino un valor de tipo Stream, posteriormente creo una matriz a partir de dicho TRecord.
Cargo y uso la matriz y posteriormente la libero mediante SetLength.
Tras ésto ¿los streams creados han sido también liberados o se deben liberar explicitamente?

Gracias de antemano, un saludo.


Código Delphi [-]
interface


type   
  EleCmp = Record   
  public     
    TxtNod: String;     
    DesNot: TMemoryStream;   

  end; 
 
matriz: array of EleCmp;  


implementation


procedure
    SetLength(matriz, 1);   
    matriz[0].TxtNod := 'Texto';   
    matriz[0].DesNot := TMemoryStream.Create;
    matriz[0].DesNot.CopyFrom(MiStream):
    ....
    SetLength(matriz, 0];
Responder Con Cita