summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-06-12 21:44:57 +0200
committerMichael Stahl <mstahl@redhat.com>2017-06-12 22:26:08 +0200
commit93a288bd75d7caed46d6f29bf006f3d97a9602a9 (patch)
treea4be45cb8b4b20cdfb0a94cc041807afdd53b642
parent58bb9da339d61981d45cde8e38a2ce1ae33652c4 (diff)
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
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofgraphic.cxx2
1 files changed, 2 insertions, 0 deletions
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