vitaly-t / excellent

Basic DOM Component Framework
https://vitaly-t.github.io/excellent/
MIT License
57 stars 5 forks source link

onDestroy in legacy browsers #2

Closed vitaly-t closed 6 years ago

vitaly-t commented 6 years ago

Event onDestroy is currently not fired in legacy browsers, such as IE9 and IE10, because the library uses MutationObserver to watch for elements removal from DOM, and those browsers do not support it.

A work-around is needed to add support for onDestroy in legacy browsers.

Without it, if you are allocating some resources inside controllers that need to be explicitly released, they may cause memory leaks in IE9 + IE10 browsers.

vitaly-t commented 6 years ago

Implemented and released in v0.1.5.

In IE9/10 manual garbage collector will run the check every 300ms, and send onDestroy when needed.