Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you’re await’ing a variable directly in the same scope, of course self will be retained, you’re still running inside self’s scope.

I guess I’m confused by the question… if you want to await something and allow self to be freed in the process, you can use Task{ [weak self] } and then return early. If you don’t want to return early, you can’t really release self yet, since the scope shouldn’t outlive self.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: