You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
when I use this framework to test does function has leak. Code is like below. test unit shows it has leak, but when I use deinit to test is the viewcontroller is free, the deinit function called. and when I check memory graph, it seems no leak. can you help me to figure out why the test unit shows leak?
@cillyfly The problem is that the DispatchQueue.main.async is retaining the completion block (I don't know why!), and the block retains the VC.
You can see this if you put [weak self], the test will pass.
Now, why does the DispatchQueue is retaining the closure? I am not sure. Tomorrow I'll give it another try.
Hi
when I use this framework to test does function has leak. Code is like below. test unit shows it has leak, but when I use
deinit
to test is theviewcontroller
is free, thedeinit
function called. and when I check memory graph, it seems no leak. can you help me to figure out why the test unit shows leak?Function define
Using in viewcontroller
Test code
The text was updated successfully, but these errors were encountered: