Broadcaster::AddListener(): Bail out early if the passed in Listener pointer is

NULL, instead of registering a NULL listener and to crash later.

llvm-svn: 122429
This commit is contained in:
Johnny Chen 2010-12-22 19:29:31 +00:00
parent 73f7fa82e5
commit d161a85700
1 changed files with 3 additions and 0 deletions

View File

@ -102,6 +102,9 @@ Broadcaster::AddInitialEventsToListener (Listener *listener, uint32_t requested_
uint32_t
Broadcaster::AddListener (Listener* listener, uint32_t event_mask)
{
if (listener == NULL)
return 0;
Mutex::Locker locker(m_listeners_mutex);
collection::iterator pos, end = m_listeners.end();