Kaydet (Commit) b921e409 authored tarafından Caolán McNamara's avatar Caolán McNamara

use non-leaky singleton pattern

üst 215d0764
...@@ -264,9 +264,6 @@ bool SfxApplication::Initialize_Impl() ...@@ -264,9 +264,6 @@ bool SfxApplication::Initialize_Impl()
pAppData_Impl->m_pSbxErrorHdl = new SfxErrorHandler( pAppData_Impl->m_pSbxErrorHdl = new SfxErrorHandler(
RID_BASIC_START, ERRCODE_AREA_SBX, ERRCODE_AREA_SBX_END ); RID_BASIC_START, ERRCODE_AREA_SBX, ERRCODE_AREA_SBX_END );
// diverse Pointer
SfxPickList::GetOrCreate( SvtHistoryOptions().GetSize( ePICKLIST ) );
DBG_ASSERT( !pAppData_Impl->pAppDispat, "AppDispatcher already exists" ); DBG_ASSERT( !pAppData_Impl->pAppDispat, "AppDispatcher already exists" );
pAppData_Impl->pAppDispat = new SfxDispatcher((SfxDispatcher*)0); pAppData_Impl->pAppDispat = new SfxDispatcher((SfxDispatcher*)0);
pAppData_Impl->pSlotPool = new SfxSlotPool; pAppData_Impl->pSlotPool = new SfxSlotPool;
......
...@@ -170,28 +170,10 @@ SfxPickList::PickListEntry* SfxPickList::GetPickListEntry( sal_uInt32 nIndex ) ...@@ -170,28 +170,10 @@ SfxPickList::PickListEntry* SfxPickList::GetPickListEntry( sal_uInt32 nIndex )
return 0; return 0;
} }
SfxPickList& SfxPickList::GetOrCreate( const sal_uInt32 nMenuSize )
{
if ( !pUniqueInstance )
{
::osl::MutexGuard aGuard( thePickListMutex::get() );
if ( !pUniqueInstance )
pUniqueInstance = new SfxPickList( nMenuSize );
}
return *pUniqueInstance;
}
SfxPickList& SfxPickList::Get() SfxPickList& SfxPickList::Get()
{ {
::osl::MutexGuard aGuard( thePickListMutex::get() ); static SfxPickList aUniqueInstance(SvtHistoryOptions().GetSize(ePICKLIST));
return *pUniqueInstance; return aUniqueInstance;
}
void SfxPickList::Delete()
{
::osl::MutexGuard aGuard( thePickListMutex::get() );
DELETEZ( pUniqueInstance );
} }
SfxPickList::SfxPickList( sal_uInt32 nAllowedMenuSize ) : SfxPickList::SfxPickList( sal_uInt32 nAllowedMenuSize ) :
......
...@@ -67,9 +67,7 @@ class SfxPickList : public SfxListener ...@@ -67,9 +67,7 @@ class SfxPickList : public SfxListener
void RemovePickListEntries(); void RemovePickListEntries();
public: public:
static SfxPickList& GetOrCreate( const sal_uInt32 nMenuSize );
static SfxPickList& Get(); static SfxPickList& Get();
static void Delete();
sal_uInt32 GetAllowedMenuSize() { return m_nAllowedMenuSize; } sal_uInt32 GetAllowedMenuSize() { return m_nAllowedMenuSize; }
sal_uInt32 GetNumOfEntries() const { return m_aPicklistVector.size(); } sal_uInt32 GetNumOfEntries() const { return m_aPicklistVector.size(); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment