bug fix for eventdispatcher.
memoryleak fix.
Small fix for Bug-422.cpp and MenuTest.cpp.