Fixed an error in _clearEvent. Fixed memory leaks in todolist example