Kaydet (Commit) 153afd7b authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Michael Stahl

Resolves: fdo#60144 only delete *unposted* SfxRequests accumulated during lock

When the dispatched is locked, SfxRequests accumulate in aReqArr for later
dispatch when unlocked via Post

The pointers are typically deleted in Post, so only if we never get around to
posting them do we delete the unposted requests.

regression from 528aba3a

Change-Id: I4c214791d356ce0e5401a87b968b53e4866f6174
(cherry picked from commit 1385896f)
Reviewed-on: https://gerrit.libreoffice.org/1991Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst c4c537c4
...@@ -60,12 +60,12 @@ ...@@ -60,12 +60,12 @@
#include <rtl/strbuf.hxx> #include <rtl/strbuf.hxx>
#include <deque> #include <deque>
#include <boost/ptr_container/ptr_vector.hpp> #include <vector>
DBG_NAME(SfxDispatcherFlush) DBG_NAME(SfxDispatcherFlush)
DBG_NAME(SfxDispatcherFillState) DBG_NAME(SfxDispatcherFillState)
typedef boost::ptr_vector<SfxRequest> SfxRequestPtrArray; typedef std::vector<SfxRequest*> SfxRequestPtrArray;
DECL_PTRSTACK(SfxShellStack_Impl, SfxShell*, 8, 4 ); DECL_PTRSTACK(SfxShellStack_Impl, SfxShell*, 8, 4 );
...@@ -110,7 +110,17 @@ struct SfxObjectBars_Impl ...@@ -110,7 +110,17 @@ struct SfxObjectBars_Impl
struct SfxDispatcher_Impl struct SfxDispatcher_Impl
{ {
SfxRequestPtrArray aReqArr; //When the dispatched is locked, SfxRequests accumulate in aReqArr for
//later dispatch when unlocked via Post
//
//The pointers are typically deleted in Post, only if we never get around
//to posting them do we delete the unposted requests.
SfxRequestPtrArray aReqArr;
~SfxDispatcher_Impl()
{
for (SfxRequestPtrArray::iterator aI = aReqArr.begin(), aEnd = aReqArr.end(); aI != aEnd; ++aI)
delete *aI;
}
const SfxSlotServer* pCachedServ1; // last called message const SfxSlotServer* pCachedServ1; // last called message
const SfxSlotServer* pCachedServ2; // penultimate called Message const SfxSlotServer* pCachedServ2; // penultimate called Message
SfxShellStack_Impl aStack; // active functionality SfxShellStack_Impl aStack; // active functionality
...@@ -2149,7 +2159,7 @@ void SfxDispatcher::Lock( sal_Bool bLock ) ...@@ -2149,7 +2159,7 @@ void SfxDispatcher::Lock( sal_Bool bLock )
if ( !bLock ) if ( !bLock )
{ {
for(size_t i = 0; i < pImp->aReqArr.size(); ++i) for(size_t i = 0; i < pImp->aReqArr.size(); ++i)
pImp->xPoster->Post(&pImp->aReqArr[i]); pImp->xPoster->Post(pImp->aReqArr[i]);
pImp->aReqArr.clear(); pImp->aReqArr.clear();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment