summaryrefslogtreecommitdiff
path: root/cppuhelper
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-01-13 17:55:09 +0100
committerMichael Stahl <mst@openoffice.org>2010-01-13 17:55:09 +0100
commitbf46dbcd552d7538474af43b82eb16e17e02d0a4 (patch)
treeac7e8c73413e05498ecc35ed071a9d4d517d8391 /cppuhelper
parentbb94dd8918d401094768173d99ecf5a6efeb6739 (diff)
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.
Diffstat (limited to 'cppuhelper')
-rw-r--r--cppuhelper/inc/cppuhelper/weakref.hxx6
-rwxr-xr-xcppuhelper/source/cc5_solaris_sparc.map1
-rw-r--r--cppuhelper/source/gcc3.map1
-rw-r--r--cppuhelper/source/msvc_win32_intel.map1
-rw-r--r--cppuhelper/source/weak.cxx45
5 files changed, 30 insertions, 24 deletions
diff --git a/cppuhelper/inc/cppuhelper/weakref.hxx b/cppuhelper/inc/cppuhelper/weakref.hxx
index a4f9f46eabd9..5ed14743a520 100644
--- a/cppuhelper/inc/cppuhelper/weakref.hxx
+++ b/cppuhelper/inc/cppuhelper/weakref.hxx
@@ -109,6 +109,12 @@ public:
inline SAL_CALL operator Reference< XInterface > () const SAL_THROW( () )
{ return get(); }
+ /** Releases this reference.
+
+ @since UDK 3.2.12
+ */
+ void SAL_CALL clear() SAL_THROW( () );
+
protected:
/** @internal */
OWeakRefListener * m_pImpl;
diff --git a/cppuhelper/source/cc5_solaris_sparc.map b/cppuhelper/source/cc5_solaris_sparc.map
index 0cda7be0bb7d..941465519a08 100755
--- a/cppuhelper/source/cc5_solaris_sparc.map
+++ b/cppuhelper/source/cc5_solaris_sparc.map
@@ -384,4 +384,5 @@ UDK_3.7 { # OOo 3.3
global:
__1cEcppuLOWeakObjectbAdisposeWeakConnectionPoint6M_v_;
__1cDcomDsunEstarDunoTWeakReferenceHelper2G6Mrkn0DJReference4n0DKXInterface____r4_;
+ __1cDcomDsunEstarDunoTWeakReferenceHelperFclear6M_v_;
} UDK_3.6;
diff --git a/cppuhelper/source/gcc3.map b/cppuhelper/source/gcc3.map
index 6b6bac67d8f7..099373b2e220 100644
--- a/cppuhelper/source/gcc3.map
+++ b/cppuhelper/source/gcc3.map
@@ -378,5 +378,6 @@ UDK_3.6 { # OOo 3.3
global:
_ZN4cppu11OWeakObject26disposeWeakConnectionPointEv;
_ZN3com3sun4star3uno19WeakReferenceHelperaSERKNS2_9ReferenceINS2_10XInterfaceEEE;
+ _ZN3com3sun4star3uno19WeakReferenceHelper5clearEv;
} UDK_3.5;
diff --git a/cppuhelper/source/msvc_win32_intel.map b/cppuhelper/source/msvc_win32_intel.map
index c999ae200ac2..6bc10cb175c2 100644
--- a/cppuhelper/source/msvc_win32_intel.map
+++ b/cppuhelper/source/msvc_win32_intel.map
@@ -275,4 +275,5 @@ UDK_3.5 { # OOo 3.0
UDK_3.6 { # OOo 3.3
global:
?disposeWeakConnectionPoint@OWeakObject@cppu@@IAEXXZ;
+ ?clear@WeakReferenceHelper@uno@star@sun@com@@QAAXXZ;
} UDK_3.5;
diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index 1901610d40b7..1fbfb3fa96ad 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -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( () )
{
if (this == &rWeakRef)
@@ -495,16 +514,7 @@ 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;
- }
+ clear();
if (xInt.is())
{
m_pImpl = new OWeakRefListener(xInt);
@@ -517,20 +527,7 @@ SAL_THROW( () )
WeakReferenceHelper::~WeakReferenceHelper() 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; // for safety
- }
- }
- catch (RuntimeException &) { OSL_ASSERT( 0 ); } // assert here, but no unexpected()
+ clear();
}
Reference< XInterface > WeakReferenceHelper::get() const SAL_THROW( () )