Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.0] Potential leakage when using signal of composed properties #3080

Closed
andersio opened this issue Jul 23, 2016 · 1 comment
Closed

[5.0] Potential leakage when using signal of composed properties #3080

andersio opened this issue Jul 23, 2016 · 1 comment
Labels
Milestone

Comments

@andersio
Copy link
Member

andersio commented Jul 23, 2016

Due to the signal lifetime semantics we currently have, signal of composed properties could have a potential to leak if either:

  1. It is repeatedly called; or
  2. It is called but left unused.

Consider the following snippet:

let mapped = property.map { $0 + 1 }
for _ in 0 ..< 100000 {
    _ = mapped.signal
}

It would create 100000 signals from the property that would live as long as property.

Note that even if we share the signal across invocations, the lifetime issue of such signal still persists, since the current semantics of Signal is purely emitter-controlled and push-driven.

We should revisit this after #3075 concludes. 🎄

@andersio andersio added the bug label Jul 23, 2016
@andersio andersio added this to the 5.0 milestone Jul 23, 2016
@mdiep
Copy link
Contributor

mdiep commented Aug 10, 2016

This was resolved by #2959.

@mdiep mdiep closed this as completed Aug 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants