From e221ed62e0554900bf2c75ce024be7df2a02afbc Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 24 Jun 2015 17:26:27 +0100 Subject: tdf#92258 - fix crash editing macro module name. Change-Id: I8e0bbab7d7497ed7c136ddbfba73618834d5a204 --- basctl/source/basicide/basidesh.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'basctl') diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx index 661a667f1034..9eb86f8e8626 100644 --- a/basctl/source/basicide/basidesh.cxx +++ b/basctl/source/basicide/basidesh.cxx @@ -118,9 +118,9 @@ public: virtual void SAL_CALL elementRemoved( const container::ContainerEvent& Event ) throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE { OUString sModuleName; - if( mpShell && ( Event.Accessor >>= sModuleName ) ) + if( mpShell && ( Event.Accessor >>= sModuleName ) ) { - ModulWindow* pWin = mpShell->FindBasWin(mpShell->m_aCurDocument, mpShell->m_aCurLibName, sModuleName, false, true); + VclPtr pWin = mpShell->FindBasWin(mpShell->m_aCurDocument, mpShell->m_aCurLibName, sModuleName, false, true); if( pWin ) mpShell->RemoveWindow( pWin, true, true ); } @@ -799,6 +799,8 @@ void Shell::UpdateWindows() void Shell::RemoveWindow( BaseWindow* pWindow_, bool bDestroy, bool bAllowChangeCurWindow ) { + VclPtr pWindowTmp( pWindow_ ); + DBG_ASSERT( pWindow_, "Kann keinen NULL-Pointer loeschen!" ); sal_uLong nKey = GetWindowId( pWindow_ ); pTabBar->RemovePage( (sal_uInt16)nKey ); @@ -818,7 +820,7 @@ void Shell::RemoveWindow( BaseWindow* pWindow_, bool bDestroy, bool bAllowChange { if ( !( pWindow_->GetStatus() & BASWIN_INRESCHEDULE ) ) { - pWindow_->disposeOnce(); + pWindowTmp.disposeAndClear(); } else { -- cgit v1.2.3