Giter VIP home page Giter VIP logo

Comments (5)

OrkhanAlikhanov avatar OrkhanAlikhanov commented on July 1, 2024

Hey! Thank you for your care!

DispatchQueues does not cause retain cycles, they dispose passed closure after calling them, meaning they do not retain reference to the closure passed.

To be honest, the library needs a total rewrite.

from http.swift.

jeff-h avatar jeff-h commented on July 1, 2024

Hi — thanks for your explanation. So if I can't blame my leak on your code I will have to fix mine lol

from http.swift.

jeff-h avatar jeff-h commented on July 1, 2024

Oh man. Over time my code potentially opens and closes quite a few Servers, one after the other, and they were retaining just because I forgot to call .stop() on them when I was finished with each instance 🤪 Spent such a long time searching for the cause of this leak!

Interesting, I suppose, that the Server instances appear to self-retain until stopped, but it's kinda obvious when I think about it. Anyway, definitely my fault in the end!

from http.swift.

OrkhanAlikhanov avatar OrkhanAlikhanov commented on July 1, 2024

Lol. Yeah they will retain until stopped because of missing [weak self] in the queue closure that you wanted to add. I think it would be better to do it. Would you like to send a quick PR for that?

from http.swift.

jeff-h avatar jeff-h commented on July 1, 2024

Sure, doing now :)

from http.swift.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.