Fixes wrong usage of std::vector's constructor in EventDispatcher::removeAllEventListener.

This commit is contained in:
James Chen 2016-04-07 15:50:59 +08:00 committed by minggo
parent 9c4f3ffa8d
commit f3e6e8331a
1 changed files with 2 additions and 1 deletions

View File

@ -1484,7 +1484,8 @@ void EventDispatcher::removeCustomEventListeners(const std::string& customEventN
void EventDispatcher::removeAllEventListeners()
{
bool cleanMap = true;
std::vector<EventListener::ListenerID> types(_listenerMap.size());
std::vector<EventListener::ListenerID> types;
types.reserve(_listenerMap.size());
for (const auto& e : _listenerMap)
{