문제

I have a data structure as follows.

TJustCalGroup = record
    SigName,GroupName:string;
    RawMin,RawMax:LongInt;
end;

I create an instance of the record or data structure as follows.

var ARecord := new TJustCalGroup;

Then, I want to delete the instance or mark it as being unused. So, I am doing the following.

ARecord := Nil;

However, it is not working. It keeps raising an error, "Can not assign nil to TJustCalGroup."

So, then how do you make it nil or null or free up its memory?

도움이 되었습니까?

해결책

A delphi prism (or Oxygene)record is equivalent to a Struct , the structs (or records) are value types and is allocated always on the stack (even when you uses the new operator), so you don't need free the memory.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top