Fix memory leak on events not released