Fixed a resource leak in ControlMapping.cpp and a null check problem in MediaEngine.cpp