> ## 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](/sdk/android/v2.x.x/primer/methods/configure)
method again as the Primer instance will be in a clean state.

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

## Parameters

<Expandable defaultOpen title="Parameters">
  <ResponseField name="cleanClientSessionCache" type="Boolean" post={["Default: true"]}>
    {}
  </ResponseField>
</Expandable>

## Example

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

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