Fix memory corruption problem in other part of event system.