Revert "Review feedback: fix memory leak discovered."

This reverts commit 7c10e52b9fba551f8ade7829b662bdd86817e604.
Undo most of the rest of the event dispatcher related changes in this fix. Will update with a much more elegant solution that does not disturb the existing code so much and which ensures no dangling pointers.