SfxHelp leaks, make sure it goes away at the right time

This commit is contained in:
Caolán McNamara 2011-04-19 16:15:20 +01:00
parent c6e5c7ce9b
commit cb27a8051c

View file

@ -153,6 +153,7 @@ using namespace ::com::sun::star;
// Static member
SfxApplication* SfxApplication::pApp = NULL;
static BasicDLL* pBasic = NULL;
static SfxHelp* pSfxHelp = NULL;
class SfxPropertyHandler : public PropertyHandler
{
@ -305,7 +306,6 @@ SfxApplication* SfxApplication::GetOrCreate()
::framework::SetIsDockingWindowVisible( IsDockingWindowVisible );
::framework::SetActivateToolPanel( &SfxViewFrame::ActivateToolPanel );
SfxHelp* pSfxHelp = new SfxHelp;
Application::SetHelp( pSfxHelp );
if ( SvtHelpOptions().IsHelpTips() )
Help::EnableQuickHelp();
@ -351,6 +351,8 @@ SfxApplication::SfxApplication()
#endif
#endif
pSfxHelp = new SfxHelp;
pBasic = new BasicDLL;
StarBASIC::SetGlobalErrorHdl( LINK( this, SfxApplication, GlobalBasicErrorHdl_Impl ) );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "} initialize DDE" );
@ -364,6 +366,9 @@ SfxApplication::~SfxApplication()
SfxModule::DestroyModules_Impl();
delete pSfxHelp;
Application::SetHelp( NULL );
// delete global options
SvtViewOptions::ReleaseOptions();
delete pBasic;