I've just stumbled upon the same issue. At first, I had something more complex going on in flatMap and assumed that I created a retain cycle there myself. Then I dumbed down flatMap to just returning Fail, just as in the example above and saw a memory leak. I replaced flatMap with tryMap and the leak was gone. Sadly, for my needs, I do need that flatMap, but I certainly don't understand the reason for that leak...
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: