From 45c6d948fbac77a8a6926f56579a4ceba981288f Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Thu, 12 Nov 2015 17:38:25 +0000 Subject: tdf#95551 - fix image map crash. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove listener we add, and don't crash on callback for disposed dialog. Change-Id: Ia6a1bddd212cb28a0331469e8e87324346d02841 Reviewed-on: https://gerrit.libreoffice.org/19936 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- svx/source/dialog/imapdlg.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'svx') diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index 772f9708fc44..f51829b54e76 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -184,7 +184,7 @@ SvxIMapDlg::SvxIMapDlg(SfxBindings *_pBindings, SfxChildWindow *pCW, vcl::Window m_pEdtText->SetModifyHdl( LINK( this, SvxIMapDlg, URLModifyHdl ) ); m_pCbbTarget->SetLoseFocusHdl( LINK( this, SvxIMapDlg, URLLoseFocusHdl ) ); - SvtMiscOptions aMiscOptions; + SvtMiscOptions aMiscOptions; aMiscOptions.AddListenerLink( LINK( this, SvxIMapDlg, MiscHdl ) ); m_pTbxIMapDlg1->SetSelectHdl( LINK( this, SvxIMapDlg, TbxClickHdl ) ); @@ -220,6 +220,9 @@ SvxIMapDlg::~SvxIMapDlg() void SvxIMapDlg::dispose() { + SvtMiscOptions aMiscOptions; + aMiscOptions.RemoveListenerLink( LINK( this, SvxIMapDlg, MiscHdl ) ); + // Delete URL-List pIMapWnd.disposeAndClear(); DELETEZ( pOwnData ); @@ -776,9 +779,11 @@ IMPL_LINK( SvxIMapDlg, StateHdl, IMapWindow*, pWnd ) IMPL_LINK_NOARG(SvxIMapDlg, MiscHdl) { - SvtMiscOptions aMiscOptions; - m_pTbxIMapDlg1->SetOutStyle( aMiscOptions.GetToolboxStyle() ); - + if (m_pTbxIMapDlg1) + { + SvtMiscOptions aMiscOptions; + m_pTbxIMapDlg1->SetOutStyle( aMiscOptions.GetToolboxStyle() ); + } return 0L; } -- cgit