diff --git a/common/include/gucef_basichelpers.h b/common/include/gucef_basichelpers.h index d95f7bea6..1162a516a 100644 --- a/common/include/gucef_basichelpers.h +++ b/common/include/gucef_basichelpers.h @@ -39,6 +39,8 @@ #define GUCEF_PLATFORM_H #endif /* GUCEF_PLATFORM_H ? */ +#include + /*-------------------------------------------------------------------------// // // // GENERAL MACROS // diff --git a/common/include/gucef_cpp.h b/common/include/gucef_cpp.h index b3abf6f60..a73d863fd 100644 --- a/common/include/gucef_cpp.h +++ b/common/include/gucef_cpp.h @@ -66,6 +66,14 @@ /*-------------------------------------------------------------------------*/ +#ifdef GUCEF_RVALUE_REFERENCES_SUPPORTED + #define GUCEF_MOVE( m ) std::move( m ) +#else + #define GUCEF_MOVE( m ) m +#endif + +/*-------------------------------------------------------------------------*/ + #if defined(__cplusplus) #undef GUCEF_NOEXCEPT_IS_SUPPORTED #if __cplusplus > 201103L /* >= C++ 11 : This is not fullproof since not every compiler truly supports the spec */ diff --git a/platform/gucefCORE/include/CDataNode.h b/platform/gucefCORE/include/CDataNode.h index 00cc039dd..03ea45a6e 100644 --- a/platform/gucefCORE/include/CDataNode.h +++ b/platform/gucefCORE/include/CDataNode.h @@ -112,10 +112,14 @@ class GUCEF_CORE_PUBLIC_CPP CDataNode : public CIEnumerable */ CDataNode( const CDataNode& src ); + #ifdef GUCEF_RVALUE_REFERENCES_SUPPORTED + CDataNode( CDataNode&& src ) GUCEF_NOEXCEPT; + #endif + /** * Cleans up all attributes and children */ - virtual ~CDataNode(); + virtual ~CDataNode() GUCEF_VIRTUAL_OVERRIDE; /** * Turns the given node and it's sub-tree into an replica diff --git a/platform/gucefCORE/include/CEvent.h b/platform/gucefCORE/include/CEvent.h index 6ab548be1..db9d9d88e 100644 --- a/platform/gucefCORE/include/CEvent.h +++ b/platform/gucefCORE/include/CEvent.h @@ -64,13 +64,17 @@ class GUCEF_CORE_PUBLIC_CPP CEvent { public: - CEvent( void ); + CEvent( void ) GUCEF_NOEXCEPT; - CEvent( const CString& eventName ); + CEvent( const CString& eventName ) GUCEF_NOEXCEPT; - CEvent( const char* eventName ); + CEvent( const char* eventName ) GUCEF_NOEXCEPT; - CEvent( const CEvent& src ); + CEvent( const CEvent& src ) GUCEF_NOEXCEPT; + + #ifdef GUCEF_RVALUE_REFERENCES_SUPPORTED + CEvent( CEvent&& src ) GUCEF_NOEXCEPT; + #endif ~CEvent(); @@ -113,7 +117,7 @@ class GUCEF_CORE_PUBLIC_CPP CEvent friend class CNotificationIDRegistry; CEvent( const UInt32 eventID , - const CString& eventName ); + const CString& eventName ) GUCEF_NOEXCEPT; private: diff --git a/platform/gucefCORE/include/gucefCORE_CGenericValueToDataNodeSerializer.h b/platform/gucefCORE/include/gucefCORE_CGenericValueToDataNodeSerializer.h index e127f412e..9cb80bbec 100644 --- a/platform/gucefCORE/include/gucefCORE_CGenericValueToDataNodeSerializer.h +++ b/platform/gucefCORE/include/gucefCORE_CGenericValueToDataNodeSerializer.h @@ -82,7 +82,7 @@ class GUCEF_CORE_PUBLIC_CPP CGenericValueToDataNodeSerializer : public CIValueTo CGenericValueToDataNodeSerializer( const CGenericValueToDataNodeSerializer& src ); - virtual ~CGenericValueToDataNodeSerializer(); + virtual ~CGenericValueToDataNodeSerializer() GUCEF_VIRTUAL_OVERRIDE; CGenericValueToDataNodeSerializer& operator=( const CGenericValueToDataNodeSerializer& src ); diff --git a/platform/gucefCORE/src/CDataNode.cpp b/platform/gucefCORE/src/CDataNode.cpp index 13e6f5b5c..169f16db4 100644 --- a/platform/gucefCORE/src/CDataNode.cpp +++ b/platform/gucefCORE/src/CDataNode.cpp @@ -104,6 +104,33 @@ CDataNode::CDataNode( const CDataNode& src ) } } +/*-------------------------------------------------------------------------*/ + +#ifdef GUCEF_RVALUE_REFERENCES_SUPPORTED + +CDataNode::CDataNode( CDataNode&& src ) GUCEF_NOEXCEPT + : CIEnumerable() + , m_nodeType( src.m_nodeType ) + , _name( GUCEF_MOVE( src._name ) ) + , m_value( GUCEF_MOVE( src.m_value ) ) + , _atts( GUCEF_MOVE( src._atts ) ) + , _pparent( src._pparent ) + , _pnext( src._pnext ) + , _pprev( src._pprev ) + , m_children( GUCEF_MOVE( src.m_children ) ) + , m_associatedData( src.m_associatedData ) +{GUCEF_TRACE; + + // reset source to default constructor values + src.m_nodeType = GUCEF_DATATYPE_OBJECT; + src._pparent = GUCEF_NULL; + src._pnext = GUCEF_NULL; + src._pprev = GUCEF_NULL; + src.m_associatedData = GUCEF_NULL; +} + +#endif /* GUCEF_RVALUE_REFERENCES_SUPPORTED ? */ + /*-------------------------------------------------------------------------*/ CDataNode::~CDataNode() diff --git a/platform/gucefCORE/src/CDynamicBuffer.cpp b/platform/gucefCORE/src/CDynamicBuffer.cpp index bef9e2e2f..c12673b93 100644 --- a/platform/gucefCORE/src/CDynamicBuffer.cpp +++ b/platform/gucefCORE/src/CDynamicBuffer.cpp @@ -127,7 +127,10 @@ CDynamicBuffer::CDynamicBuffer( UInt32 initialsize , if ( initialsize > 0 ) { _buffer = (Int8*) malloc( initialsize ); - _bsize = initialsize; + if ( GUCEF_NULL != _buffer ) + { + _bsize = initialsize; + } } } @@ -150,8 +153,15 @@ CDynamicBuffer::CDynamicBuffer( const CDynamicBuffer &src , _bsize = src.m_dataSize; if ( _bsize > 0 ) { - _buffer = (Int8*) malloc( src.m_dataSize ); - memcpy( _buffer, src._buffer, m_dataSize ); + _buffer = (Int8*) malloc( src.m_dataSize ); + if ( GUCEF_NULL != _buffer ) + { + memcpy( _buffer, src._buffer, m_dataSize ); + } + else + { + _bsize = m_dataSize = 0; + } } } else @@ -160,7 +170,14 @@ CDynamicBuffer::CDynamicBuffer( const CDynamicBuffer &src , if ( _bsize > 0 ) { _buffer = (Int8*) malloc( src._bsize ); - memcpy( _buffer, src._buffer, m_dataSize ); + if ( GUCEF_NULL != _buffer ) + { + memcpy( _buffer, src._buffer, m_dataSize ); + } + else + { + _bsize = m_dataSize = 0; + } } } } diff --git a/platform/gucefCORE/src/CEvent.cpp b/platform/gucefCORE/src/CEvent.cpp index f76d7cb64..42279282c 100644 --- a/platform/gucefCORE/src/CEvent.cpp +++ b/platform/gucefCORE/src/CEvent.cpp @@ -57,7 +57,7 @@ namespace CORE { // // //-------------------------------------------------------------------------*/ -CEvent::CEvent( void ) +CEvent::CEvent( void ) GUCEF_NOEXCEPT : m_eventID( 0 ) , m_eventName() {GUCEF_TRACE; @@ -65,7 +65,7 @@ CEvent::CEvent( void ) /*-------------------------------------------------------------------------*/ -CEvent::CEvent( const char* eventName ) +CEvent::CEvent( const char* eventName ) GUCEF_NOEXCEPT : m_eventID( 0 ) , m_eventName( eventName ) {GUCEF_TRACE; @@ -75,7 +75,7 @@ CEvent::CEvent( const char* eventName ) /*-------------------------------------------------------------------------*/ -CEvent::CEvent( const CORE::CString& eventName ) +CEvent::CEvent( const CORE::CString& eventName ) GUCEF_NOEXCEPT : m_eventID( 0 ) , m_eventName( eventName ) {GUCEF_TRACE; @@ -85,8 +85,23 @@ CEvent::CEvent( const CORE::CString& eventName ) /*-------------------------------------------------------------------------*/ +#ifdef GUCEF_RVALUE_REFERENCES_SUPPORTED + +CEvent::CEvent( CEvent&& src ) GUCEF_NOEXCEPT + : m_eventID( src.m_eventID ) , + m_eventName( GUCEF_MOVE( src.m_eventName ) ) +{GUCEF_TRACE; + + // reset source to default constructor values + src.m_eventID = 0; +} + +#endif /* GUCEF_RVALUE_REFERENCES_SUPPORTED ? */ + +/*-------------------------------------------------------------------------*/ + CEvent::CEvent( const UInt32 eventID , - const CString& eventName ) + const CString& eventName ) GUCEF_NOEXCEPT : m_eventID( eventID ) , m_eventName( eventName ) {GUCEF_TRACE; @@ -95,8 +110,8 @@ CEvent::CEvent( const UInt32 eventID , /*-------------------------------------------------------------------------*/ -CEvent::CEvent( const CEvent& src ) - : m_eventID( src.m_eventID ) , +CEvent::CEvent( const CEvent& src ) GUCEF_NOEXCEPT + : m_eventID( src.m_eventID ) , m_eventName( src.m_eventName ) {GUCEF_TRACE; diff --git a/platform/gucefCORE/src/CPumpedObserver.cpp b/platform/gucefCORE/src/CPumpedObserver.cpp index c31c47b35..74f480700 100644 --- a/platform/gucefCORE/src/CPumpedObserver.cpp +++ b/platform/gucefCORE/src/CPumpedObserver.cpp @@ -281,9 +281,12 @@ CPumpedObserver::ClearMailbox( bool acceptNewMail ) &dataptr ) ) { maildata = static_cast< CMailElement* >( dataptr ); - GUCEF_DELETE maildata->GetCallback(); - GUCEF_DELETE maildata->GetData(); - GUCEF_DELETE maildata; + if ( GUCEF_NULL != maildata ) + { + GUCEF_DELETE maildata->GetCallback(); + GUCEF_DELETE maildata->GetData(); + GUCEF_DELETE maildata; + } } if ( acceptNewMail ) @@ -338,33 +341,41 @@ CPumpedObserver::OnPulse( CNotifier* notifier , if ( m_notificationsHolds <= 0 ) { + MT::CTMailBox< CEvent >::TMailBoxMailRemovalBlock mailRemovalBlock( m_mailbox ); + CEvent mailEventID; CICloneable* dataptr( GUCEF_NULL ); CMailElement* maildata( GUCEF_NULL ); - while ( m_mailbox.PeekMail( mailEventID , - &dataptr ) ) + while ( m_mailbox.PeekMail( mailRemovalBlock , + mailEventID , + &dataptr ) ) { try { maildata = static_cast< CMailElement* >( dataptr ); - CIEventHandlerFunctorBase* callback = maildata->GetCallback(); - if ( GUCEF_NULL == callback ) - { - OnPumpedNotify( maildata->GetNotifier() , - mailEventID , - maildata->GetData() ); - } - else + if ( GUCEF_NULL != maildata ) { - OnPumpedFunctorNotify( maildata->GetNotifier() , - mailEventID , - maildata->GetData() , - callback ); - - GUCEF_DELETE callback; + CICloneable* eventData = maildata->GetData(); + CIEventHandlerFunctorBase* callback = maildata->GetCallback(); + CNotifier* eventNotifier = maildata->GetNotifier(); + if ( GUCEF_NULL == callback ) + { + OnPumpedNotify( eventNotifier , + mailEventID , + eventData ); + } + else + { + OnPumpedFunctorNotify( eventNotifier , + mailEventID , + eventData , + callback ); + + GUCEF_DELETE callback; + } + + GUCEF_DELETE eventData; } - - GUCEF_DELETE maildata->GetData(); } catch ( const timeout_exception& ) { @@ -373,7 +384,7 @@ CPumpedObserver::OnPulse( CNotifier* notifier , return; } - m_mailbox.PopMail(); + m_mailbox.PopMail( mailRemovalBlock ); } } diff --git a/platform/gucefMT/include/gucefMT_CTMailBox.h b/platform/gucefMT/include/gucefMT_CTMailBox.h index 33c494d44..06fe0892c 100644 --- a/platform/gucefMT/include/gucefMT_CTMailBox.h +++ b/platform/gucefMT/include/gucefMT_CTMailBox.h @@ -63,6 +63,9 @@ namespace MT { // // //-------------------------------------------------------------------------*/ +template < typename T > +class CTMailBoxMailRemovalBlock; + /** * Basicly a tread-safe stack for passing data event data between * multiple threads @@ -79,10 +82,12 @@ class CTMailBox : public virtual MT::CILockable }; typedef struct SMailElement TMailElement; + typedef T value_type; typedef std::vector< TMailElement, basic_allocator< TMailElement > > TMailVector; typedef std::deque< TMailElement, basic_allocator< TMailElement > > TMailQueue; - typedef typename std::deque< TMailElement >::iterator iterator; - typedef typename std::deque< TMailElement >::const_iterator const_iterator; + typedef typename std::deque< TMailElement >::iterator iterator; + typedef typename std::deque< TMailElement >::const_iterator const_iterator; + typedef CTMailBoxMailRemovalBlock< T > TMailBoxMailRemovalBlock; CTMailBox( void ); @@ -121,14 +126,15 @@ class CTMailBox : public virtual MT::CILockable * @param data cloneable data container for optional event data. * @return whether mail was successfully retrieved from the mailbox. */ - bool PeekMail( T& eventid , - CICloneable** data ); + bool PeekMail( TMailBoxMailRemovalBlock& removalBlock , + T& eventid , + CICloneable** data ); /** * Removes the first mail item in the mail stack * Intended to be used in combination with PeekMail() */ - bool PopMail( void ); + bool PopMail( TMailBoxMailRemovalBlock& removalBlock ); /** * Attempts to retrieve mail from the mailbox. @@ -145,11 +151,11 @@ class CTMailBox : public virtual MT::CILockable bool GetMailList( TMailVector& mailList , Int32 maxMailItems = -1 ); - void Clear( void ); + bool Clear( void ); - void ClearAllExcept( const T& eventid ); + bool ClearAllExcept( const T& eventid ); - void Delete( const T& eventid ); + bool Delete( const T& eventid ); bool HasMail( void ) const; @@ -157,6 +163,10 @@ class CTMailBox : public virtual MT::CILockable void SetAcceptsNewMail( bool acceptNewMail ); + void SetMailRemovalAllowed( bool allowMailRemoval ); + + bool IsMailRemovalAllowed( void ) const; + TLockStatus DoLock( UInt32 lockWaitTimeoutInMs = GUCEF_MT_DEFAULT_LOCK_TIMEOUT_IN_MS ) const; TLockStatus DoUnlock( void ) const; @@ -188,12 +198,58 @@ class CTMailBox : public virtual MT::CILockable TMailQueue m_mailQueue; bool m_acceptsNewMail; + bool m_mailRemovalAllowed; CMutex m_datalock; }; +/*--------------------------------------------------------------------------*/ + +template < typename T > +class CTMailBoxMailRemovalBlock +{ + public: + + typedef T value_type; + typedef CTMailBox< T > TMailBoxType; + + private: + + TMailBoxType* m_mailbox; + + public: + + CTMailBoxMailRemovalBlock( TMailBoxType& mailbox ) + : m_mailbox( &mailbox ) + {GUCEF_TRACE; + + GUCEF_ASSERT( GUCEF_NULL != m_mailbox ); + m_mailbox->SetMailRemovalAllowed( false ); + } + + ~CTMailBoxMailRemovalBlock() + {GUCEF_TRACE; + + GUCEF_ASSERT( GUCEF_NULL != m_mailbox ); + m_mailbox->SetMailRemovalAllowed( true ); + } + + bool EarlyUnblock( void ) + {GUCEF_TRACE; + + if ( GUCEF_NULL != m_mailbox ) + m_mailbox->SetMailRemovalAllowed( true ); + return true; + } + + private: + + CTMailBoxMailRemovalBlock( const CTMailBoxMailRemovalBlock& src ); /**< dont use */ + CTMailBoxMailRemovalBlock& operator=( const CTMailBoxMailRemovalBlock& src ); /**< dont use */ +}; + /*-------------------------------------------------------------------------// // // -// UTILITIES // +// IMPLEMENTATION // // // //-------------------------------------------------------------------------*/ @@ -202,6 +258,7 @@ CTMailBox< T >::CTMailBox( void ) : MT::CILockable() , m_mailQueue() , m_acceptsNewMail( true ) + , m_mailRemovalAllowed( true ) , m_datalock() {GUCEF_TRACE; @@ -214,6 +271,7 @@ CTMailBox< T >::~CTMailBox() {GUCEF_TRACE; m_acceptsNewMail = false; + m_mailRemovalAllowed = true; Clear(); } @@ -259,6 +317,27 @@ CTMailBox< T >::SetAcceptsNewMail( bool acceptNewMail ) /*--------------------------------------------------------------------------*/ +template< typename T > +void +CTMailBox< T >::SetMailRemovalAllowed( bool allowMailRemoval ) +{GUCEF_TRACE; + + CObjectScopeLock lock( this ); + m_mailRemovalAllowed = allowMailRemoval; +} + +/*--------------------------------------------------------------------------*/ + +template< typename T > +bool +CTMailBox< T >::IsMailRemovalAllowed( void ) const +{GUCEF_TRACE; + + return m_mailRemovalAllowed; +} + +/*--------------------------------------------------------------------------*/ + template< typename T > bool CTMailBox< T >::GetMail( T& eventid , @@ -267,7 +346,7 @@ CTMailBox< T >::GetMail( T& eventid , CObjectScopeLock lock( this ); - if ( !m_mailQueue.empty() ) + if ( !m_mailQueue.empty() && m_mailRemovalAllowed ) { TMailElement& entry = m_mailQueue.front(); eventid = entry.eventid; @@ -290,14 +369,17 @@ CTMailBox< T >::GetMail( T& eventid , template< typename T > bool -CTMailBox< T >::PeekMail( T& eventid , - CICloneable** data ) +CTMailBox< T >::PeekMail( TMailBoxMailRemovalBlock& removalBlock , + T& eventid , + CICloneable** data ) {GUCEF_TRACE; CObjectScopeLock lock( this ); if ( !m_mailQueue.empty() ) { + m_mailRemovalAllowed = false; + TMailElement& entry = m_mailQueue.front(); eventid = entry.eventid; if ( GUCEF_NULL != data ) @@ -314,12 +396,14 @@ CTMailBox< T >::PeekMail( T& eventid , template< typename T > bool -CTMailBox< T >::PopMail( void ) +CTMailBox< T >::PopMail( TMailBoxMailRemovalBlock& removalBlock ) {GUCEF_TRACE; CObjectScopeLock lock( this ); - if ( !m_mailQueue.empty() ) + removalBlock.EarlyUnblock(); + + if ( !m_mailQueue.empty() && m_mailRemovalAllowed ) { TMailElement& entry = m_mailQueue.front(); GUCEF_DELETE entry.data; @@ -340,120 +424,142 @@ CTMailBox< T >::GetMailList( TMailVector& mailList , CObjectScopeLock lock( this ); Int32 mailItemsRead = 0; - while ( mailItemsRead < maxMailItems || maxMailItems < 0 ) - { - if ( !m_mailQueue.empty() ) - { - mailList.push_back( m_mailQueue.front() ); - m_mailQueue.pop_front(); - - ++mailItemsRead; - } - else + if ( m_mailRemovalAllowed ) + { + while ( mailItemsRead < maxMailItems || maxMailItems < 0 ) { - break; + if ( !m_mailQueue.empty() ) + { + mailList.push_back( m_mailQueue.front() ); + m_mailQueue.pop_front(); + + ++mailItemsRead; + } + else + { + break; + } } } - return mailItemsRead > 0; } /*--------------------------------------------------------------------------*/ template< typename T > -void +bool CTMailBox< T >::Clear( void ) {GUCEF_TRACE; CObjectScopeLock lock( this ); - - typename TMailQueue::iterator i( m_mailQueue.begin() ); - while ( i != m_mailQueue.end() ) + + if ( m_mailRemovalAllowed ) { - GUCEF_DELETE (*i).data; - ++i; + typename TMailQueue::iterator i( m_mailQueue.begin() ); + while ( i != m_mailQueue.end() ) + { + GUCEF_DELETE (*i).data; + ++i; + } + m_mailQueue.clear(); + return true; } - m_mailQueue.clear(); + return false; } /*--------------------------------------------------------------------------*/ template< typename T > -void +bool CTMailBox< T >::ClearAllExcept( const T& eventid ) {GUCEF_TRACE; CObjectScopeLock lock( this ); - - #if __cplusplus >= 201103L - - // C++11 added the erase() - typename TMailQueue::iterator i( m_mailQueue.begin() ); - while ( i != m_mailQueue.end() ) + + if ( m_mailRemovalAllowed ) { - if ( (*i).eventid != eventid ) + #if __cplusplus >= 201103L + + // C++11 added the erase() + typename TMailQueue::iterator i( m_mailQueue.begin() ); + while ( i != m_mailQueue.end() ) { - GUCEF_DELETE (*i).data; - i = m_mailQueue.erase( i ); - continue; + if ( (*i).eventid != eventid ) + { + GUCEF_DELETE (*i).data; + i = m_mailQueue.erase( i ); + continue; + } + ++i; } - ++i; - } - #else + #else - TMailQueue copyQueue; - while ( !m_mailQueue.empty() ) - { - if ( m_mailQueue.front().eventid == eventid ) - copyQueue.push_back( m_mailQueue.front() ); - else - GUCEF_DELETE m_mailQueue.front().data; - m_mailQueue.pop_front(); + TMailQueue copyQueue; + while ( !m_mailQueue.empty() ) + { + if ( m_mailQueue.front().eventid == eventid ) + copyQueue.push_back( m_mailQueue.front() ); + else + GUCEF_DELETE m_mailQueue.front().data; + m_mailQueue.pop_front(); + } + m_mailQueue = copyQueue; + + #endif + + return true; } - m_mailQueue = copyQueue; - #endif + return false; } /*--------------------------------------------------------------------------*/ template< typename T > -void +bool CTMailBox< T >::Delete( const T& eventid ) {GUCEF_TRACE; CObjectScopeLock lock( this ); - #if __cplusplus >= 201103L - - // C++11 added the erase() - typename TMailQueue::iterator i( m_mailQueue.begin() ); - while ( i != m_mailQueue.end() ) + if ( m_mailRemovalAllowed ) { - if ( (*i).eventid == eventid ) + + #if __cplusplus >= 201103L + + // C++11 added the erase() + typename TMailQueue::iterator i( m_mailQueue.begin() ); + while ( i != m_mailQueue.end() ) { - GUCEF_DELETE (*i).data; - i = m_mailQueue.erase( i ); - continue; + if ( (*i).eventid == eventid ) + { + GUCEF_DELETE (*i).data; + i = m_mailQueue.erase( i ); + continue; + } + ++i; } - ++i; - } - #else + #else - TMailQueue copyQueue; - while ( !m_mailQueue.empty() ) - { - if ( m_mailQueue.front().eventid != eventid ) - copyQueue.push_back( m_mailQueue.front() ); - else - GUCEF_DELETE m_mailQueue.front().data; - m_mailQueue.pop_front(); + TMailQueue copyQueue; + while ( !m_mailQueue.empty() ) + { + if ( m_mailQueue.front().eventid != eventid ) + copyQueue.push_back( m_mailQueue.front() ); + else + GUCEF_DELETE m_mailQueue.front().data; + m_mailQueue.pop_front(); + } + m_mailQueue = copyQueue; + + #endif + + return true; } - m_mailQueue = copyQueue; - #endif + return false; } /*--------------------------------------------------------------------------*/ @@ -535,7 +641,10 @@ typename CTMailBox< T >::TMailQueue::iterator CTMailBox< T >::erase( typename TMailQueue::iterator& index ) {GUCEF_TRACE; - return m_mailQueue.erase( index ); + if ( m_mailRemovalAllowed ) + return m_mailQueue.erase( index ); + else + return m_mailQueue.end(); } /*--------------------------------------------------------------------------*/ diff --git a/platform/gucefPUBSUB/src/gucefPUBSUB_CPubSubClientSide.cpp b/platform/gucefPUBSUB/src/gucefPUBSUB_CPubSubClientSide.cpp index 8db1f565c..48a31cb2c 100644 --- a/platform/gucefPUBSUB/src/gucefPUBSUB_CPubSubClientSide.cpp +++ b/platform/gucefPUBSUB/src/gucefPUBSUB_CPubSubClientSide.cpp @@ -2240,14 +2240,16 @@ void CPubSubClientSide::TopicLink::ProcessAcknowledgeReceiptsMailbox( void ) {GUCEF_TRACE; + TPubSubMsgPtrMailbox::TMailBoxMailRemovalBlock mailRemovalBlock( publishAckdMsgsMailbox ); + CIPubSubMsg::TNoLockSharedPtr msg; - while ( publishAckdMsgsMailbox.PeekMail( msg, GUCEF_NULL ) ) + while ( publishAckdMsgsMailbox.PeekMail( mailRemovalBlock, msg, GUCEF_NULL ) ) { try { if ( AcknowledgeReceiptSync( msg ) ) { - publishAckdMsgsMailbox.PopMail(); + publishAckdMsgsMailbox.PopMail( mailRemovalBlock ); } else {