davidchang/ngReact — pull request #5 by pootzko (2014-08-22 18:29:25+00:00)
Title: Fixed memory leak caused by route change and "hanging" DOM elements

This commit fixes a memory leak caused by unloading Angular templates. Basically what happens is if you remove the Angular template, React components it contained would not get unmounted and would cause React components to leave DOM elements hanging around. This caused the browser to consume more and more memory until it became completely unresponsive. The effect can be experienced on huge lists with very high number of DOM elements (tracked it down using Chrome dev tools profiling).

I simply added React.unmountComponentAtNode() on directive scope $destroy which fixed the issue.

The patch is applied only to the unminified version ov ngReact and new ngReact.min should be generated after pull.