Bug 1001833 - "TypeError: can't access dead object" due leaks of event/dom module

Maybe worth putting this into a util?