ApplicationPurgeReleasedAPIObjects Method |
Explicitly purges all API objects that have been released but are still awaiting to be finalized
Namespace: Autodesk.Revit.ApplicationServicesAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic void PurgeReleasedAPIObjects()
Public Sub PurgeReleasedAPIObjects
public:
void PurgeReleasedAPIObjects()
member PurgeReleasedAPIObjects : unit -> unit
Remarks
Revit purges API objects automatically every time when command control returns from
an API application (an external command, event handler, etc.) back to Revit.
This is necessary because Revit does not allow API objects to be finalized when the
finalization is invoked from an outside thread (from the garbage collector, specifically).
This automatic purging is adequate in most scenarios. When an application uses a lot
of API objects during one single command though, it may be necessary or beneficial
to invoke an additional purge explicitly to free the deleted API objects from memory.
See Also