This method creates a copy of the input array before disposal to prevent
modification during the disposal process, making it safe to use even if
disposal methods modify the original array.
Parameters
disposables: DisposableItemArray
Array of objects to dispose. The array itself can be null or undefined.
OptionaltrapExceptions: boolean
If true, catches exceptions during disposal instead of throwing them.
Returns void
Example
constresources = [connection1, stream2, timer3]; dispose.these(resources); // Safe even if disposal modifies the original array dispose.these(resources, true); // Catch exceptions during disposal
Disposes an array of disposable objects.
This method creates a copy of the input array before disposal to prevent modification during the disposal process, making it safe to use even if disposal methods modify the original array.