RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDataContext.AddObjectToDestroy Method

Stores an object that can be freed when the data context is finished.

Pascal
procedure AddObjectToDestroy(Obj: TObject);
C++
__fastcall AddObjectToDestroy(TObject * Obj);

Call AddObjectToDestroy to add an object instance to the list of temporary objects that TDataContext maintains. When the TDataContext instance is freed, it frees all the objects in this list of temporary objects.

Note: TDataContext does not provide access to this list. The caller must keep a reference to the object for use while the TDataContext instance exists.
 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!