Page tree
Skip to end of metadata
Go to start of metadata

void FB::JSAPIImpl::unregisterEventMethod ( const std::string &  name,
JSObjectPtr event 
)
virtual

Called by the browser to unregister an event handler method.

Parameters
nameThe name.
eventThe event handler method to unregister.

Reimplemented from FB::JSAPI.

Definition at line 266 of file JSAPIImpl.cpp.

Referenced by unregisterEventMethod().

267 {
268  if (!event)
269  throw invalid_arguments();
270 
271  boost::recursive_mutex::scoped_lock _l(m_eventMutex);
272  std::pair<EventMultiMap::iterator, EventMultiMap::iterator> range = m_eventMap[event->getEventContext()].equal_range(name);
273 
274  for (EventMultiMap::iterator it = range.first; it != range.second; ++it) {
275  if (it->second->getEventId() == event->getEventId()) {
276  m_eventMap[event->getEventContext()].erase(it);
277  return;
278  }
279  }
280 }
Thrown by a JSAPI object when the argument(s) provided to a SetProperty or Invoke call are found to b...
Definition: JSExceptions.h:47
  • No labels