openlayers/ol3 — pull request #1695 by twpayne (2014-02-13 13:49:37+00:00)
Title: Save replay group, even if empty

This PR comes from an investigation into a potential memory leak with @fredj.

@fredj observed that the rendering of an empty vector source would leak a DOM Node each frame. Further investigation revealed that these were `` elements allocated for the hit detection canvas.

The problem turned out to be that replay groups were not being saved if they were empty. This meant that a new replay group was created each frame, which resulted in the allocation of a `` element for hit detection each frame.

This PR fixes the problem by ensuring that empty replay groups are re-used.