clean up memory after event dispatching (as often as possible)