Memory leak found is very hard to track down :disa...
# kotlin-native
i
Memory leak found is very hard to track down 😞
o
Think Valgrind could help here
i
Well, I uses Mac OS X.
it happens in NSURLSession with a delegate or callback.
s
If you're using a block based wrapper around NSURLSession it can be easy to create a circular reference. The basic delegate callback mechanism of NSURLSession uses a weak reference and should not create a memory leak.
In your block wrapper if the block contains a reference to
this
inside of it, it will create a circular reference. You need to make it a weak reference.