// XInterface void SvxShapeCollection::release() noexcept
{
uno::Reference< uno::XInterface > x( xDelegator ); if (! x.is())
{ if (osl_atomic_decrement( &m_refCount ) == 0)
{ if (! bDisposed)
{
uno::Reference< uno::XInterface > xHoldAlive( getXWeak() ); // First dispose try
{
dispose();
} catch(css::uno::Exception&)
{ // release should not throw exceptions
}
// only the alive ref holds the object
OSL_ASSERT( m_refCount == 1 ); // destroy the object if xHoldAlive decrement the refcount to 0 return;
}
} // restore the reference count
osl_atomic_increment( &m_refCount );
}
OWeakAggObject::release();
}
// XComponent void SvxShapeCollection::dispose()
{ // An frequently programming error is to release the last // reference to this object in the disposing message. // Make it robust, hold a self Reference.
uno::Reference< lang::XComponent > xSelf( this );
// Guard dispose against multiple threading // Remark: It is an error to call dispose more than once
{
std::unique_lock aGuard( m_aMutex ); if( bDisposed || bInDispose ) return; // only one call go into this section
bInDispose = true;
}
// Do not hold the mutex because we are broadcasting // Create an event with this as sender try
{
document::EventObject aEvt;
aEvt.Source = uno::Reference< uno::XInterface >::query( static_cast<lang::XComponent *>(this) ); // inform all listeners to release this object // The listener container are automatically cleared
std::unique_lock g(m_aMutex);
maEventListeners.disposeAndClear( g, aEvt );
maShapeContainer.clear();
// bDisposed and bInDispose must be set in this order.
bDisposed = true;
bInDispose = false;
} catch(const css::uno::Exception&)
{ // catch exception and throw again but signal that // the object was disposed. Dispose should be called // only once.
bDisposed = true;
bInDispose = false; throw;
}
}
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.12Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.