Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1993

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/93/1993/1

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 528aba3a9cf91da5ce70c6d631d7b82e203f8086

Change-Id: I4c214791d356ce0e5401a87b968b53e4866f6174
(cherry picked from commit 1385896fe760fe61b19a682cb7dc7fdf31d31490)
---
M sfx2/source/control/dispatch.cxx
1 file changed, 14 insertions(+), 4 deletions(-)



diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 676e028..e14723a 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -69,12 +69,12 @@
 #include <rtl/strbuf.hxx>
 
 #include <deque>
-#include <boost/ptr_container/ptr_vector.hpp>
+#include <vector>
 
 DBG_NAME(SfxDispatcherFlush)
 DBG_NAME(SfxDispatcherFillState)
 
-typedef boost::ptr_vector<SfxRequest> SfxRequestPtrArray;
+typedef std::vector<SfxRequest*> SfxRequestPtrArray;
 
 SV_IMPL_PTRARR( SfxItemPtrArray, SfxPoolItemPtr );
 DECL_PTRSTACK(SfxShellStack_Impl, SfxShell*, 8, 4 );
@@ -120,7 +120,17 @@
 
 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* pCachedServ2;  // penultimate called Message
     SfxShellStack_Impl   aStack;        // active functionality
@@ -2162,7 +2172,7 @@
     if ( !bLock )
     {
         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();
     }
 }

-- 
To view, visit https://gerrit.libreoffice.org/1993
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4c214791d356ce0e5401a87b968b53e4866f6174
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-3-6
Gerrit-Owner: Caolán McNamara <caolanm@redhat.com>

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.