> ## Documentation Index
> Fetch the complete documentation index at: https://primer.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# cleanup

Call this method to dispose of the listener and free Primer SDK resources,
which will also avoid memory leaks. Once this occurs, you can call the [configure](https://primer.io/docs/sdk/android/v2.x.x/primer/methods/configure.md)
method again as the Primer instance will be in a clean state.

```kotlin KOTLIN theme={"dark"}
fun cleanup(cleanClientSessionCache: Boolean = true)
```

## Parameters

**Parameters**

**cleanClientSessionCache** `Boolean`

## Example

```kotlin KOTLIN theme={"dark"}
class CheckoutActivity : AppCompatActivity() {
  // ...

  private fun cleanupUniversalCheckout() {
    // 👇 Add this
    Primer.instance.cleanup()
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.