Hmm, I have some mouse events that are added and then removed each time a
zoom or pan is performed, but the registeredEvents_ list will continue to
grow and grow. In those cases, I do not want to call this.g.addEvent.

On Tue, Feb 12, 2013 at 11:41 AM, Robert Konigsberg <
notifications@github.com> wrote:

> In plugins/range-selector.js:
>
> >
> >    if (this.isUsingExcanvas_) {
> > -    this.dygraph_.addEvent(this.iePanOverlay_, 'mousedown', onPanStart);
> > +    Dygraph.addEvent(this.iePanOverlay_, 'mousedown', onPanStart);
>
> By going from this.g.addEvent to Dygraph.addEvent, then when the graph is
> destroyed references remain alive. This results in memory leaks, and ought
> to be avoided. (Actually, perhaps we should remove Dygraph.addEvent
> altogether.)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/danvk/dygraphs/pull/217/files#r2980707>.
>
>