diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-11-12 17:38:25 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-11-13 15:24:57 +0000 |
commit | 45c6d948fbac77a8a6926f56579a4ceba981288f (patch) | |
tree | 7f171703a0d273733ae07e252b388cb1dc8847db | |
parent | d11d0915730f5eefda3f610a9e2c549a39cf655d (diff) |
tdf#95551 - fix image map crash.
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 <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | svx/source/dialog/imapdlg.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
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; } |