joseph / Monocle

A silky, tactile browser-based ebook JavaScript library.
http://monocle.inventivelabs.com.au
MIT License
743 stars 200 forks source link

Selection Polling Timer is not getting disposed when we destroy monocle . #202

Closed NirbhayK closed 10 years ago

NirbhayK commented 10 years ago

This is an orphan timer running inside selection.js. Is there a call to destroy it?

  function initialize() {
    if (k.SELECTION_POLLING_INTERVAL) {
      setInterval(pollSelection, k.SELECTION_POLLING_INTERVAL);
    }
  }
joseph commented 10 years ago

Hm, no, but you could turn off selection polling by setting that constant to null. I tend to run each Monocle reader in its own iframe, so that destroying it is simply a case of replacing the iframe (or setting its src to somewhere else).