impress195: #i112510# Stop leaking task pane FocusManager singleton.
This commit is contained in:
parent
a800b0d9fd
commit
cff2fd0093
19
sd/source/ui/toolpanel/TaskPaneFocusManager.cxx
Normal file → Executable file
19
sd/source/ui/toolpanel/TaskPaneFocusManager.cxx
Normal file → Executable file
@ -31,9 +31,9 @@
|
||||
#include "TaskPaneFocusManager.hxx"
|
||||
|
||||
#include <vcl/window.hxx>
|
||||
#include <vos/mutex.hxx>
|
||||
#include <vcl/svapp.hxx>
|
||||
#include <vcl/event.hxx>
|
||||
#include <rtl/instance.hxx>
|
||||
#include <hash_map>
|
||||
|
||||
namespace {
|
||||
@ -70,16 +70,23 @@ class FocusManager::LinkMap
|
||||
|
||||
|
||||
|
||||
FocusManager* FocusManager::spInstance = NULL;
|
||||
|
||||
|
||||
FocusManager& FocusManager::Instance (void)
|
||||
{
|
||||
static FocusManager* spInstance = NULL;
|
||||
|
||||
if (spInstance == NULL)
|
||||
{
|
||||
::vos::OGuard aGuard (::Application::GetSolarMutex());
|
||||
::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex());
|
||||
if (spInstance == NULL)
|
||||
spInstance = new FocusManager ();
|
||||
{
|
||||
static FocusManager aInstance;
|
||||
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
|
||||
spInstance = &aInstance;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
|
||||
}
|
||||
return *spInstance;
|
||||
}
|
||||
|
1
sd/source/ui/toolpanel/TaskPaneFocusManager.hxx
Normal file → Executable file
1
sd/source/ui/toolpanel/TaskPaneFocusManager.hxx
Normal file → Executable file
@ -103,7 +103,6 @@ public:
|
||||
bool TransferFocus (::Window* pSource, const KeyCode& rCode);
|
||||
|
||||
private:
|
||||
static FocusManager* spInstance;
|
||||
class LinkMap;
|
||||
::std::auto_ptr<LinkMap> mpLinks;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user