client-sdk-swift icon indicating copy to clipboard operation
client-sdk-swift copied to clipboard

Fix memory leaks in AppStateListener and Room

Open viachaslauinnowise opened this issue 2 months ago • 1 comments

Fix: memory leaks in AppStateListener observers and Room cleanup

AppStateListener:

  • Store NotificationCenter observer tokens for proper cleanup
  • Add deinit to remove all observers
  • Use [weak self] in all observer closures

Room:

  • Remove from AppStateListener.delegates in deinit (safety net)
  • Explicitly remove in cleanUp() (primary path)
  • Prevent memory leaks when Room is destroyed without cleanUp()

viachaslauinnowise avatar Dec 18 '25 12:12 viachaslauinnowise

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Dec 18 '25 12:12 CLAassistant