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

New commits:
commit 93a288bd75d7caed46d6f29bf006f3d97a9602a9
Author: Michael Stahl <mst...@redhat.com>
Date:   Mon Jun 12 21:44:57 2017 +0200

    svx: fix the std::unique_ptr that deletes itself twice
    
    It's good that the obviously error prone C++98 bare pointer was replaced
    with a modern C++11 std::unique_ptr - everyone knows that with such modern
    idioms memory management errors will be a thing of the past!
    
    (regression from commit e4e4d5713e248f02faf7aa6199b11e152973de8e)
    
        
svxcorelo.dll!sdr::event::AsynchGraphicLoadingEvent::~AsynchGraphicLoadingEvent()
 Line 57       C++
        svxcorelo.dll!sdr::event::AsynchGraphicLoadingEvent::`scalar deleting 
destructor'(unsigned int)     C++
        
svxcorelo.dll!std::default_delete<sdr::event::AsynchGraphicLoadingEvent>::operator()(sdr::event::AsynchGraphicLoadingEvent
 * _Ptr) Line 1608        C++
        
svxcorelo.dll!std::unique_ptr<sdr::event::AsynchGraphicLoadingEvent,std::default_delete<sdr::event::AsynchGraphicLoadingEvent>
 >::reset(sdr::event::AsynchGraphicLoadingEvent * _Ptr) Line 1855     C++
        
svxcorelo.dll!std::unique_ptr<sdr::event::AsynchGraphicLoadingEvent,std::default_delete<sdr::event::AsynchGraphicLoadingEvent>
 >::operator=(void * __formal) Line 1728      C++
        
svxcorelo.dll!sdr::contact::ViewObjectContactOfGraphic::forgetAsynchGraphicLoadingEvent(sdr::event::AsynchGraphicLoadingEvent
 * pEvent) Line 231    C++
        
svxcorelo.dll!sdr::event::AsynchGraphicLoadingEvent::~AsynchGraphicLoadingEvent()
 Line 59   C++
        svxcorelo.dll!sdr::event::AsynchGraphicLoadingEvent::`scalar deleting 
destructor'(unsigned int)     C++
        
svxcorelo.dll!std::default_delete<sdr::event::AsynchGraphicLoadingEvent>::operator()(sdr::event::AsynchGraphicLoadingEvent
 * _Ptr) Line 1608        C++
        
svxcorelo.dll!std::unique_ptr<sdr::event::AsynchGraphicLoadingEvent,std::default_delete<sdr::event::AsynchGraphicLoadingEvent>
 
>::~unique_ptr<sdr::event::AsynchGraphicLoadingEvent,std::default_delete<sdr::event::AsynchGraphicLoadingEvent>
 >() Line 1820        C++
        
svxcorelo.dll!sdr::contact::ViewObjectContactOfGraphic::~ViewObjectContactOfGraphic()
 Line 306      C++
        svxcorelo.dll!sdr::contact::ViewObjectContactOfGraphic::`scalar 
deleting destructor'(unsigned int)  C++
        svxcorelo.dll!sdr::contact::ObjectContact::~ObjectContact() Line 62 C++
        
svxcorelo.dll!sdr::contact::ObjectContactOfPageView::~ObjectContactOfPageView() 
Line 72     C++
        svxcorelo.dll!sdr::contact::ObjectContactOfPageView::`scalar deleting 
destructor'(unsigned int)     C++
        svxcorelo.dll!SdrPageWindow::ResetObjectContact() Line 482  C++
        svxcorelo.dll!SdrPageWindow::~SdrPageWindow() Line 135      C++
    
    Change-Id: I989a800581e80befff3dcc37e7b8ffd370c2d7e8

diff --git a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx 
b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
index 16c15b41909b..98a8c8b1b416 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
@@ -302,6 +302,8 @@ namespace sdr
 
         ViewObjectContactOfGraphic::~ViewObjectContactOfGraphic()
         {
+            // explicitly call this to avoid it double-freeing itself
+            forgetAsynchGraphicLoadingEvent(mpAsynchLoadEvent.get());
         }
     } // end of namespace contact
 } // end of namespace sdr
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to