Yes, I'm now calling Dygraph.addEvent only when I'm manually removing the
handlers later.

On Tue, Feb 12, 2013 at 12:50 PM, 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);
>
> As long as you can handle allocation and deallocation in a good way.
> … <#13ccf8813020d6d8_>
> On Tue, Feb 12, 2013 at 12:15 PM, Paul Felix <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); 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. …
> <#13ccf6834d2c5966_> 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>. — Reply to
> this email directly or view it on GitHub<
> https://github.com/danvk/dygraphs/pull/217/files#r2981330>.
>  -- Robert Konigsberg
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/danvk/dygraphs/pull/217/files#r2981915>.
>
>