Method RegisterDisposeLater
RegisterDisposeLater(IDisposable)
Registers a node-owned disposable object for automatic disposal when this graph execution ends.
public void RegisterDisposeLater(IDisposable resource)
Parameters
resourceIDisposableThe execution-owned disposable object to register.
Remarks
Use this overload for transient resources that already implement IDisposable or for a node-defined disposable bundle that releases several related resources. Register it immediately after creation. Registration transfers ownership to the graph, so the node must not call Dispose() afterward. Resources are disposed in reverse registration order on completion or when the execution handle is disposed. Do not register borrowed, shared, cached, or pooled resources.
Exceptions
- ArgumentNullException
resourceis null.- ObjectDisposedException
The execution's transient-resource registry has already been disposed.