티스토리 뷰

System.SysUtils.FreeAndNil

Delphi

procedure FreeAndNil(var Obj);

C++

extern PACKAGE void __fastcall FreeAndNil(void *Obj);

Properties

Type

Visibility

Source

Unit

Parent

procedure

function

public

System.SysUtils.pas

System.SysUtils.hpp

System.SysUtils

System.SysUtils

Description

Frees an object reference and replaces the reference with nil (Delphi) or NULL (C++).

Use FreeAndNil to ensure that a variable is nil (Delphi) or NULL (C++) after you free the object it references.

Pass any variable that represents an object as the Obj parameter.

Warning: Obj must be an instance of a TObject descendant.

For C++, a reference to the object must be passed to FreeAndNil. For example: 

TObject *obj = new TObject();
FreeAndNil(&obj);

 

객체 참조를 해제하고 참조를 nil (Delphi) 또는 NULL (C ++)로 바꿉니다.

FreeAndNil을 사용하여 참조하는 객체를 해제한 후에 변수가 nil (Delphi) 또는 NULL (C ++)인지 확인하십시오.

오브젝트를 나타내는 모든 변수를 Obj 매개변수로 전달하십시오.

경고: Obj TObject 자손의 인스턴스여야 합니다.

C ++의 경우 객체에 대한 참조를 FreeAndNil에 전달해야 합니다. :

 

Example

var

  Obj: TObject;

begin

  Obj := TObject.Create();

  FreeAndNil(Obj);

end.

 

descendant 미국·영국 [dɪ|sendənt]   영국식   중요

1. 자손, 후손, 후예
2. (
과거의 비슷한 것에서) 유래한 것

 

출처: http://docwiki.embarcadero.com/Libraries/XE2/en/System.SysUtils.FreeAndNil

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함