RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDataContext.RemoveObjectToDestroy Method

Remove an object from the list of objects to free when the data context is freed.

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

Call RemoveObjectToDestroy to remove an object instance from the list of temporary objects that TDataContext maintains. This prevents TDataContext from freeing the object when it is itself freed. 

For example, TRemotable descendants that are created by a Web Service application when it executes an invokable interface call are automatically added to a data context that persists for the length of the method call. When an application changes the remotable object's DataContext property, it automatically calls RemoveObjectToDestroy so that the object is not automatically freed when the method call is complete. 

 

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