# destroySingleton method

1. @protected

void destroySingleton(

1. String name

)
inherited

Destroy the given pod. Delegates to destroyPod if a corresponding disposable pod instance is found.

This method handles the complete destruction lifecycle including:

- Removal from singleton caches
- Dependency cleanup
- Disposable pod destruction
- Contained pod destruction

`name`: The name of the pod to destroy

Example:

    registry.destroySingleton('userService');

## Implementation

    @protected
    void destroySingleton(String name) {
      // Destroy the corresponding DisposablePod instance
      var pod = _disposablePods[name];
      synchronized(_disposablePods, () => pod = _disposablePods.remove(name));

      if(pod != null) {
        destroyPod(name, pod!.getValue());
      }

      // Remove a registered singleton of the given name, if any
      removeSingleton(name);
    }