Martin icon indicating copy to clipboard operation
Martin copied to clipboard

memory leak

Open LuigiBertoneri opened this issue 3 years ago • 1 comments

Describe the bug We found memory leaks in the library. Every time the app gets active from the background, memory leaks are generated from XMPPDNSSrvResolver resolve(timeout: TimeInterval) Our app stops connection when goes in background.

To Reproduce Steps to reproduce the behavior:

  1. Open XCode instruments and open leaks and start recording
  2. open the app, go in background, wait few seconds and reopen the app
  3. you can see the memory leak appear, try few times the step 2
  4. stop recording leaks and wait the finish
  5. at the end you can see appear error on XMPPDNSSrvResolver resolve(timeout: TimeInterval)

Expected behavior there you have 2 closures one inside another the last generate a retain. Here you need the [weak self] or unowned than after you need to arrange the code on your choice

Screenshots I've attached 2 screenshots to better understand

Smartphone:

  • Device: tested with iPhone 11 / iPhone 11 pro Max but i think all iphone with iOS
  • OS: iOS 16.02
  • Version Martin Master lastest
Schermata 2022-10-21 alle 13 30 04 Schermata 2022-10-21 alle 13 29 38

LuigiBertoneri avatar Oct 21 '22 11:10 LuigiBertoneri

Fix was applied in ada5d7e2720964a84f98e7546402568428210a46

hantu85 avatar Oct 22 '22 11:10 hantu85

Thanks, it works.

LuigiBertoneri avatar Nov 08 '22 10:11 LuigiBertoneri