[Libreoffice-commits] core.git: sd/source

Julien Nabet serval2412 at yahoo.fr
Sun Nov 22 01:01:37 PST 2015


 sd/source/ui/dlg/sdtreelb.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit b388be4ec8a23337af5569ded370773a7b93fa55
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Nov 22 10:00:45 2015 +0100

    cppcheck: fix 1 memleak
    
    Change-Id: Ic738033bc9a10df4ddc26c4538a6969d389dc631

diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index e10f241..4fd673a 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1207,11 +1207,6 @@ void SdPageObjsTLB::DoDrag()
 
         bIsInDrag = true;
 
-        // object is destroyed by internal reference mechanism
-        SdTransferable* pTransferable =
-                new SdPageObjsTLB::SdPageObjsTransferable(
-                            *this, aBookmark, *pDocShell, eDragType);
-
         // Get the view.
         ::sd::ViewShell* pViewShell = GetViewShellForDocShell(*pDocShell);
         if (pViewShell == nullptr)
@@ -1226,6 +1221,11 @@ void SdPageObjsTLB::DoDrag()
             return;
         }
 
+        // object is destroyed by internal reference mechanism
+        SdTransferable* pTransferable =
+                new SdPageObjsTLB::SdPageObjsTransferable(
+                            *this, aBookmark, *pDocShell, eDragType);
+
         SdrObject* pObject = nullptr;
         void* pUserData = GetCurEntry()->GetUserData();
         if (pUserData != nullptr && pUserData != reinterpret_cast<void*>(1))


More information about the Libreoffice-commits mailing list