swunolocking1: #i108161#: WeakReferenceHelper:
Apple g++ 4.0.1 erroneously believes that it is ambiguous to use WeakReference<XInterface>::operator=(Reference<XInterface>). as a workaround, introduce WeakReferenceHelper::clear(), and fix all users.
This commit is contained in:
@@ -109,6 +109,12 @@ public:
|
|||||||
inline SAL_CALL operator Reference< XInterface > () const SAL_THROW( () )
|
inline SAL_CALL operator Reference< XInterface > () const SAL_THROW( () )
|
||||||
{ return get(); }
|
{ return get(); }
|
||||||
|
|
||||||
|
/** Releases this reference.
|
||||||
|
|
||||||
|
@since UDK 3.2.12
|
||||||
|
*/
|
||||||
|
void SAL_CALL clear() SAL_THROW( () );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/** @internal */
|
/** @internal */
|
||||||
OWeakRefListener * m_pImpl;
|
OWeakRefListener * m_pImpl;
|
||||||
|
@@ -384,4 +384,5 @@ UDK_3.7 { # OOo 3.3
|
|||||||
global:
|
global:
|
||||||
__1cEcppuLOWeakObjectbAdisposeWeakConnectionPoint6M_v_;
|
__1cEcppuLOWeakObjectbAdisposeWeakConnectionPoint6M_v_;
|
||||||
__1cDcomDsunEstarDunoTWeakReferenceHelper2G6Mrkn0DJReference4n0DKXInterface____r4_;
|
__1cDcomDsunEstarDunoTWeakReferenceHelper2G6Mrkn0DJReference4n0DKXInterface____r4_;
|
||||||
|
__1cDcomDsunEstarDunoTWeakReferenceHelperFclear6M_v_;
|
||||||
} UDK_3.6;
|
} UDK_3.6;
|
||||||
|
@@ -378,5 +378,6 @@ UDK_3.6 { # OOo 3.3
|
|||||||
global:
|
global:
|
||||||
_ZN4cppu11OWeakObject26disposeWeakConnectionPointEv;
|
_ZN4cppu11OWeakObject26disposeWeakConnectionPointEv;
|
||||||
_ZN3com3sun4star3uno19WeakReferenceHelperaSERKNS2_9ReferenceINS2_10XInterfaceEEE;
|
_ZN3com3sun4star3uno19WeakReferenceHelperaSERKNS2_9ReferenceINS2_10XInterfaceEEE;
|
||||||
|
_ZN3com3sun4star3uno19WeakReferenceHelper5clearEv;
|
||||||
} UDK_3.5;
|
} UDK_3.5;
|
||||||
|
|
||||||
|
@@ -275,4 +275,5 @@ UDK_3.5 { # OOo 3.0
|
|||||||
UDK_3.6 { # OOo 3.3
|
UDK_3.6 { # OOo 3.3
|
||||||
global:
|
global:
|
||||||
?disposeWeakConnectionPoint@OWeakObject@cppu@@IAEXXZ;
|
?disposeWeakConnectionPoint@OWeakObject@cppu@@IAEXXZ;
|
||||||
|
?clear@WeakReferenceHelper@uno@star@sun@com@@QAAXXZ;
|
||||||
} UDK_3.5;
|
} UDK_3.5;
|
||||||
|
@@ -479,6 +479,25 @@ WeakReferenceHelper::WeakReferenceHelper(const WeakReferenceHelper& rWeakRef) SA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WeakReferenceHelper::clear() SAL_THROW( () )
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (m_pImpl)
|
||||||
|
{
|
||||||
|
if (m_pImpl->m_XWeakConnectionPoint.is())
|
||||||
|
{
|
||||||
|
m_pImpl->m_XWeakConnectionPoint->removeReference(
|
||||||
|
(XReference*)m_pImpl);
|
||||||
|
m_pImpl->m_XWeakConnectionPoint.clear();
|
||||||
|
}
|
||||||
|
m_pImpl->release();
|
||||||
|
m_pImpl = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (RuntimeException &) { OSL_ASSERT( 0 ); } // assert here, but no unexpected()
|
||||||
|
}
|
||||||
|
|
||||||
WeakReferenceHelper& WeakReferenceHelper::operator=(const WeakReferenceHelper& rWeakRef) SAL_THROW( () )
|
WeakReferenceHelper& WeakReferenceHelper::operator=(const WeakReferenceHelper& rWeakRef) SAL_THROW( () )
|
||||||
{
|
{
|
||||||
if (this == &rWeakRef)
|
if (this == &rWeakRef)
|
||||||
@@ -495,16 +514,7 @@ SAL_THROW( () )
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (m_pImpl)
|
clear();
|
||||||
{
|
|
||||||
if (m_pImpl->m_XWeakConnectionPoint.is())
|
|
||||||
{
|
|
||||||
m_pImpl->m_XWeakConnectionPoint->removeReference((XReference*)m_pImpl);
|
|
||||||
m_pImpl->m_XWeakConnectionPoint.clear();
|
|
||||||
}
|
|
||||||
m_pImpl->release();
|
|
||||||
m_pImpl = 0;
|
|
||||||
}
|
|
||||||
if (xInt.is())
|
if (xInt.is())
|
||||||
{
|
{
|
||||||
m_pImpl = new OWeakRefListener(xInt);
|
m_pImpl = new OWeakRefListener(xInt);
|
||||||
@@ -517,20 +527,7 @@ SAL_THROW( () )
|
|||||||
|
|
||||||
WeakReferenceHelper::~WeakReferenceHelper() SAL_THROW( () )
|
WeakReferenceHelper::~WeakReferenceHelper() SAL_THROW( () )
|
||||||
{
|
{
|
||||||
try
|
clear();
|
||||||
{
|
|
||||||
if (m_pImpl)
|
|
||||||
{
|
|
||||||
if (m_pImpl->m_XWeakConnectionPoint.is())
|
|
||||||
{
|
|
||||||
m_pImpl->m_XWeakConnectionPoint->removeReference((XReference*)m_pImpl);
|
|
||||||
m_pImpl->m_XWeakConnectionPoint.clear();
|
|
||||||
}
|
|
||||||
m_pImpl->release();
|
|
||||||
m_pImpl = 0; // for safety
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (RuntimeException &) { OSL_ASSERT( 0 ); } // assert here, but no unexpected()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference< XInterface > WeakReferenceHelper::get() const SAL_THROW( () )
|
Reference< XInterface > WeakReferenceHelper::get() const SAL_THROW( () )
|
||||||
|
Reference in New Issue
Block a user