<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/IOReporter_IVars/handleSwapCleanup",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOReporter_IVars@F@handleSwapCleanup#I#"
  },
  "title" : "handleSwapCleanup"
}
-->

# handleSwapCleanup

```
virtual void handleSwapCleanup(int swapNChannels);
```

## Parameters

`swapNChannels`

channel-relative size of the _swap buffers

## Discussion

\abstract release and forget unused buffers
\discussion ::handleSwapCleanup() is responsible for deallocating the buffers
no longer used after a swap.  It must always be called if
SwapPrepare() completes successfully.  Because bufers may be
swapped in and out of existance, the _swap* variables may be
NULL and should be set to NULL when complete.

Locking: The caller must ensure that the *config* lock is HELD but
that the reporter (data) lock is *NOT HELD*.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)