Class DestroyedState
-
- All Implemented Interfaces:
-
com.inmobi.media.ads.common.base.state.State
public final class DestroyedState implements State
Represents the final state when an ad unit manager has been destroyed and is cleaning up resources.
This state is the terminal state in the ad unit manager lifecycle. It handles the destruction of all associated components including the AdUnit, AdUnitTimeoutManager, and IAdManagerComponent. The cleanup process is performed asynchronously and ensures proper resource deallocation and coroutine scope cancellation to prevent memory leaks.
-
-
Constructor Summary
Constructors Constructor Description DestroyedState(AdUnit adUnit, AdUnitTimeoutManager adUnitTimeout, IAdManagerComponent adManagerComponent)
-
Method Summary
Modifier and Type Method Description Unitinitialize()Initializes the destroyed state and performs cleanup operations. -
-
Constructor Detail
-
DestroyedState
DestroyedState(AdUnit adUnit, AdUnitTimeoutManager adUnitTimeout, IAdManagerComponent adManagerComponent)
-
-
Method Detail
-
initialize
Unit initialize()
Initializes the destroyed state and performs cleanup operations.
This method orchestrates the destruction process by:
Destroying the timeout manager to cancel any pending timeouts
Destroying the ad unit to release ad-specific resources
Finishing the logger to flush any pending logs
Cancelling the ad manager scope to stop all coroutines
Nullifying all references to prevent memory leaks
The cleanup is performed asynchronously to avoid blocking the main thread.
-
-
-
-