I have a program with a form that I'm opening and closing several times. I am using a TLOBLocator to read BLOB data and display it in a memo field. I thought that it would be a good idea to free the TLOBLocator upon finishing my reading of the data but when I reentered the form I received an Access Violation the first time that I executed any of the methods for the TOracleQuery Object that the TLOBLocator was referencing. Is it necessary to manually free the TLOBLocator and if so, then how and where?
I've included the procedure where I'm referencing the TLOBLocator.
Thanks,
t.paul
Procedure TfrmDetails.SetDtlQuery(strDocID, strSectID : string);
var
LOB: TLOBLocator;
k: integer;
blobchar: pchar;
begin
qryDtl.Close;
qryDtl.SetVariable('DOCID',strDocID);
qryDtl.SetVariable('SECTID',strSectID);
qryDtl.Execute;
memDetail.Lines.Clear;
while not qryDtl.Eof do begin
LOB := qryDtl.LOBField('xrawdata');
k := LOB.Size;
GetMem(blobchar,k);
LOB.Read(blobchar^,k);
memDetail.Lines.Append(copy(blobchar,1,k));
FreeMem(blobchar);
qryDtl.Next;
end;
// LOB.Free;
frmDetails.showmodal;
end;