fixed event pointer memory leaks in tests