There's no API for removing event handlers. Right now, they are removed when the application terminates. There is a Feature request open in froglogic's task tracker for this though (SQUISH-2663), you could mention that ticket ID in a feature request to squish@froglogic.com to raise the priority of that feature.