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

Caolán McNamara caolanm at redhat.com
Wed Jun 21 20:29:53 UTC 2017


 svx/source/sdr/contact/viewobjectcontactofgraphic.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit aa58890324bf15560c66fcb58a19c169da228c2e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 21 13:09:54 2017 +0100

    Resolves: tdf#108610 crash on double delete of async event
    
    regression from...
    
    commit e4e4d5713e248f02faf7aa6199b11e152973de8e
    Date:   Wed May 31 15:40:25 2017 +0200
    
        clang-tidy readability-delete-null-pointer
    
        which in turn triggered some loplugin:useuniqueptr
    
    lets revert the fix of
    
    commit 93a288bd75d7caed46d6f29bf006f3d97a9602a9
    Date:   Mon Jun 12 21:44:57 2017 +0200
    
        svx: fix the std::unique_ptr that deletes itself twice
    
    and make the code do exactly like it always did pre initial change
    
    Change-Id: Ia922fccdc476e40b5c672b097b04c229215ce38e
    Reviewed-on: https://gerrit.libreoffice.org/39052
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
index 98a8c8b1b416..70d676a4ddef 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
@@ -207,7 +207,7 @@ namespace sdr
             // #i103720# forget event to avoid possible deletion by the following ActionChanged call
             // which may use createPrimitive2DSequence/impPrepareGraphicWithAsynchroniousLoading again.
             // Deletion is actually done by the scheduler who leaded to coming here
-            mpAsynchLoadEvent = nullptr;
+            mpAsynchLoadEvent.release();
 
             // Invalidate all paint areas and check existing animation (which may have changed).
             GetViewContact().ActionChanged();
@@ -226,7 +226,7 @@ namespace sdr
                     "ViewObjectContactOfGraphic::forgetAsynchGraphicLoadingEvent: Forced to forget another event then I have scheduled (?)");
 
                 // forget event
-                mpAsynchLoadEvent = nullptr;
+                mpAsynchLoadEvent.release();
             }
         }
 
@@ -302,8 +302,6 @@ namespace sdr
 
         ViewObjectContactOfGraphic::~ViewObjectContactOfGraphic()
         {
-            // explicitly call this to avoid it double-freeing itself
-            forgetAsynchGraphicLoadingEvent(mpAsynchLoadEvent.get());
         }
     } // end of namespace contact
 } // end of namespace sdr


More information about the Libreoffice-commits mailing list