Polymer/ShadowDOM — pull request #512 by jmesserly (2014-09-23 04:08:25+00:00)
Title: free transient observers at end of microtask

Since we try to be lazy when scheduling observers, we need to make sure to schedule ones that have transient observers. Otherwise, we never free the transient observer, and it is stuck observing a disconnected tree, keeping it alive in memory.

(before https://github.com/Polymer/ShadowDOM/pull/505, this issue was much less likely to manifest because if a change record matched any observer, all transient observers would be cleaned up. After that change, only those observers who matched the record would get their transients cleaned up.)

Thanks to @donny-dont for helping track down these leaks. I'm not to the bottom of all of them yet, but this seems like a step in the right direction.