blackberry/BB10-WebWorks-Framework — pull request #603 by gtanner (2013-01-30 02:04:59+00:00)
Title: Unregister events when window is unloading

Fixes #546

Keep a list of events that are registered and on beforeunload
call removeEventListener for each of them.

There is no need to worry about if the user calls remove since
calling remove with an event and func that doesn't exist does
nothing, keeps the code simpler. The same goes for worrying
about grouping / keeping track of duplicates since the extra
calls to remove does nothing.