motion-wiretap icon indicating copy to clipboard operation
motion-wiretap copied to clipboard

Memory management is for suckers!

Open colinta opened this issue 10 years ago • 1 comments

It would be great if we didn't have to retain all the Wiretap instances.

colinta avatar Feb 28 '14 05:02 colinta

I don't yet have a clever way to avoid this unfortunate state of affairs, other than keeping some global list of wiretaps. UG to that.

How does ReactiveCocoa do it, anyone know? I'd love to mimic that.

Indeed, active signals (those with subscribers) are retained in a global list.

I'm not sure how ReactiveCocoa accomplishes the "auto shutdown" of signals that rely on notifications and key-value observation.

KVO based signals are "disposed" of when either the target or the observer are deallocated.

kastiglione avatar Feb 28 '14 06:02 kastiglione