diff options
author | Rüdiger Timm <rt@openoffice.org> | 2006-03-06 09:16:47 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2006-03-06 09:16:47 +0000 |
commit | 972fc603c7967db22e07ca58ca971d04ef6353b1 (patch) | |
tree | cdc105828b58bbbc56e58b3431ead74694f6e0a3 /cppu/source/uno/assign.hxx | |
parent | b01acca6a596a0770c00323ec176e280669b5862 (diff) |
INTEGRATION: CWS dbo510 (1.16.6); FILE MERGED
2005/10/31 14:16:56 dbo 1.16.6.1: #i56799# postponing interface release calls after assignment
#i44541# fixed assignData() self assignment MSVC alloca(0) returns same address for two subsequent calls
Diffstat (limited to 'cppu/source/uno/assign.hxx')
-rw-r--r-- | cppu/source/uno/assign.hxx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/cppu/source/uno/assign.hxx b/cppu/source/uno/assign.hxx index 7bb92d0478b2..4f52d52cc340 100644 --- a/cppu/source/uno/assign.hxx +++ b/cppu/source/uno/assign.hxx @@ -4,9 +4,9 @@ * * $RCSfile: assign.hxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: rt $ $Date: 2005-09-08 08:50:26 $ + * last change: $Author: rt $ $Date: 2006-03-06 10:16:47 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -56,8 +56,9 @@ inline void _assignInterface( SAL_THROW( () ) { _acquire( pSource, acquire ); - _release( *ppDest, release ); + void * const pToBeReleased = *ppDest; *ppDest = pSource; + _release( pToBeReleased, release ); } //-------------------------------------------------------------------------------------------------- inline void * _queryInterface( @@ -246,7 +247,7 @@ inline sal_Bool _assignData( SAL_THROW( () ) { if (pDest == pSource) - return sal_True; + return _type_equals( pDestType, pSourceType ); if (! pSource) { @@ -595,8 +596,9 @@ inline sal_Bool _assignData( { // A null reference of any interface type can be converted to a null // reference of any other interface type: - _release(*static_cast< void ** >(pDest), release); + void * const pToBeReleased = *static_cast< void ** >(pDest); *static_cast< void ** >(pDest) = 0; + _release( pToBeReleased, release ); return true; } else @@ -617,12 +619,12 @@ inline sal_Bool _assignData( } // query for interface: - void * pQueried = _queryInterface( - *reinterpret_cast<void **>(pSource), - pDestType, queryInterface ); + void * pQueried = _queryInterface( *static_cast<void **>(pSource), + pDestType, queryInterface ); if (pQueried != 0) { - _release( *reinterpret_cast<void **>(pDest), release ); - *reinterpret_cast<void **>(pDest) = pQueried; + void * const pToBeReleased = *static_cast<void **>(pDest); + *static_cast<void **>(pDest) = pQueried; + _release( pToBeReleased, release ); } return (pQueried != 0); } |