Skip to content

Fixing Memory Leaks

Henrik Vendelbo edited this page Oct 28, 2013 · 1 revision

Leaving Page - Clean Up

When you are leaving the page the library will try to clean up using the "unload" event. However this might bee to late or never be called, so if possible call the following when you know that you are going to reload the page or navigate away.

function link_click(ev) {
  Resolver("essential::cleanRecursively::")(document.body);
  Resolver("page").set("state.livepage",false);
  Resolver("page").set("state.launched",false);
}

In the future

If you have an <a href> the click event listener on the body will set "state.livepage" and "state.launched" to false triggering a full discard.

This behavior can be disabled using a meta tag.

Clone this wiki locally