FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
void ActiveXBrowserHost::DoDeferredRelease ( ) const
virtual

Releases any browser-specific objects that were destroyed on a thread other than the main thread. Usually safe to just let FireBreath deal with this.

Since
1.4b3

Implements FB::BrowserHost.

Definition at line 304 of file ActiveXBrowserHost.cpp.

References FB::BrowserHost::assertMainThread(), and FB::SafeQueue< Data >::try_pop().

305 {
307  IDispatchWRef deferred;
308  while (m_deferredObjects.try_pop(deferred)) {
309  if (deferred.expired())
310  continue;
311  IDispatchSRef ptr(deferred.lock());
312  IDispatchRefList::iterator it(m_heldIDispatch.begin());
313  IDispatchRefList::iterator end(m_heldIDispatch.end());
314  while (it != end) {
315  if (*it == ptr) {
316  m_heldIDispatch.erase(it);
317  break;
318  } else ++it;
319  }
320  ptr->getPtr()->Release();
321  }
322  // Also remove any expired cached IDispatch WeakReferences
323  IDispatchExRefMap::iterator iter = m_cachedIDispatch.begin();
324  IDispatchExRefMap::iterator endIter = m_cachedIDispatch.end();
325  while (iter != endIter) {
326  if (isExpired(*iter))
327  iter = m_cachedIDispatch.erase(iter);
328  else
329  ++iter;
330  }
331 }
bool try_pop(Data &popped_value)
Try to pop a value off the front of the queue; if the queue is empty returns false.
Definition: SafeQueue.h:75
void assertMainThread() const
When running in debug mode, asserts that the call is made on the main thread.

Here is the call graph for this function: