System.TObject.Disposed

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

property Disposed: Boolean read GetDisposed;

プロパティ

種類 可視性 ソース ユニット
property protected System.pas System TObject


説明

Disposed は、このオブジェクトの現在の状態を示す読み取り専用プロパティです。

DisposeOf メソッドを使ってオブジェクトが既に破棄されている場合、Disposed プロパティは True を返します。そうでない場合は False を返します。

type
  TMySimpleClass = class
  private
    //
    stringMember: String;
    constructor Create(Text: String);
    destructor Destroy;
  end;

constructor TMySimpleClass.Create(Text: String);
begin
  stringMember := Text;
end;

destructor TMySimpleClass.Destroy;
begin
  // this will be executed on calling the DisposeOf method.
end;

var
  myObject: TMySimpleClass;
begin
  myObject := TMySimpleClass.Create
    ('This is a code snippet illustrating the functionality for the DisposeOf method and Disposed property');
  if not myObject.Disposed then
    myObject.DisposeOf;
  //Starting here, the object has entered the Disposed state.
end.

メモ: System.TObject.DisposeOf メソッドは Delphi モバイル コンパイラでサポートされています。Disposed 状態は、自動参照カウントを使用するコンパイラ(DCCIOSARM.EXEDCCIOSARM64.EXEDCCIOS32.EXE など)でのみ有効です。

関連項目