티스토리 뷰

System.TObject.Free

Up to Parent: TObject

Delphi

procedure Free;

C++

void    __fastcall Free();

Properties

Type

Visibility

Source

Unit

Parent

procedure

function

public

System.pas

systobj.h

System

TObject

Description

Destroys an object / and frees its associated memory, / if necessary.

필요한 경우 객체를 삭제하고 연관된 메모리를 해제합니다.


Use Free to destroy an object. 

Free / automatically calls the destructor / if the object reference is not nil.

Any object / instantiated at run time / that does not have an owner / should be destroyed by a call to Free, / so that it can be properly disposed of / and its memory released.

Unlike Destroy, / Free / is successful even if the object is nil;

if the object was never initialized, / Free / would not result in an error.


Free를 사용하여 객체를 파괴합니다.

Free는 객체 참조가 nil이 아니면 소멸자를 자동으로 호출합니다.

런타임에 인스턴스화된 소유자가 없는 객체는 Free를 호출하여 파기해야, 적절하게 처리하고 메모리를 해제 할 수 있습니다.

Destroy와는 달리 Free는 객체가 nil 인 경우에도 성공합니다.

객체가 초기화되지 않은 경우 Free는 오류를 발생시키지 않습니다.


When you call Free for a component, / it calls Free / for all components that it owns—that is, / all components in its component list.

Since a form owns / all the controls and other components / that are created on it in design mode, / those components are automatically freed / when the form is freed.

By default, all forms / are owned by the Application object; / when the application terminates, / it frees the Application object, / which frees all forms.

For objects that are not components, / or for components created with a nil owner, / be sure to call Free after you are finished with them; / otherwise / the allocated memory will not be usable / until after the application terminates.


구성 요소에 대해 Free를 호출하면, 자신이 소유한 모든 구성 요소, 즉 구성 요소 목록의 모든 구성 요소에 대해 Free가 호출됩니다.

폼은 디자인 모드에서 생성된 모든 컨트롤과 기타 구성 요소를 소유하므로 폼이 해제되면 해당 구성 요소가 자동으로 해제됩니다.

기본적으로 모든 폼은 Application 개체가 소유합니다. 응용 프로그램이 종료되면, Application 개체가 해제되어 모든 폼이 해제됩니다.

구성 요소가 아닌 객체 또는 nil 소유자로 생성된 구성 요소의 경우 완료 후에 Free를 호출해야 합니다. 그렇지 않으면 응용 프로그램이 종료 될 때까지 할당된 메모리를 사용할 수 없습니다.


Warning: Never explicitly free a component / within one of its own event handlers / or the event handler of a component it owns or contains.

For example, / do not free / a button or the form that owns the button / in its OnClick event handler.

경고 : 자체 이벤트 핸들러 또는 소유 또는 포함하고 있는 구성 요소의 이벤트 핸들러 중 하나에 있는 구성 요소를 명시적으로 해제하지 마십시오.

예를 들어, OnClick 이벤트 핸들러에서 단추 또는 단추를 소유하는 폼을 해제하지 마십시오.

 

To free a form, / call its _Release method, / which destroys the form / and releases the memory allocated for it after / all its event handlers / and those of the components it contains / are through executing.

Note: In C++ code, / do not use Free to destroy an object. Use the delete keyword.

폼을 해제하려면, __Release 메서드를 호출하여 폼을 파괴하고, 모든 이벤트 핸들러와 (이벤트 핸들러가) 포함된 구성 요소의 메모리를 모두 실행한 후에 할당된 메모리를 해제합니다.

참고 : C ++ 코드에서 Free를 사용하여 객체를 파괴하지 마십시오. delete 키워드를 사용하십시오.

 

associated 미국식 [ə|soʊʃieɪtɪd] 

1. 관련된   2. (어떤 단체를) 지지하는   3. (사업체 이름에 쓰여) 연합의

properly 미국식 [|prɑ:pərli] 

1. 제대로, 적절히   2. (사회적도덕적으로) 올바로   3. 실은, 사실

disposed 미국식 [dɪ|spoʊzd] 

1. (~할) 마음이 있는   2. ~ (좋게나쁘게) 생각하는

released 

임무가 해제된

even if/though 

…에도 불구하고[…이긴 하지만]; …라 하더라도

since 미국·영국 [sɪns] 

1. …부터   2. (화가 나서 하는 말로) 언제부터 (…했다고 그래)?   3. …한 이후로, …한 때...

explicitly

명쾌하게

release 미국·영국 [rɪ|li:s] 

1. (갇히거나 구속되어 있는 상태에서) 풀어 주다, 석방하다   2. (잡고 있거나 막혀 있던 것을) 놓아 주다[날려 보내다/방출하다]

 

출처: http://docwiki.embarcadero.com/Libraries/XE2/en/System.TObject.Free

'프로그래밍 언어 > Delphi' 카테고리의 다른 글

[Reference] ADODB.TADOQuery.SQL  (0) 2017.01.04
[Reference] TDataSet.FieldByName  (0) 2017.01.03
[Reference] ADODB.TADOQuery  (0) 2016.12.31
[Reference] TDataSet.AfterPost  (0) 2016.12.30
[Reference] TDataSet.BeforePost  (0) 2016.12.28
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/02   »
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
글 보관함