impress195: #i112510# Stop leaking task pane FocusManager singleton.
This commit is contained in:
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 "TaskPaneFocusManager.hxx"
|
||||||
|
|
||||||
#include <vcl/window.hxx>
|
#include <vcl/window.hxx>
|
||||||
#include <vos/mutex.hxx>
|
|
||||||
#include <vcl/svapp.hxx>
|
#include <vcl/svapp.hxx>
|
||||||
#include <vcl/event.hxx>
|
#include <vcl/event.hxx>
|
||||||
|
#include <rtl/instance.hxx>
|
||||||
#include <hash_map>
|
#include <hash_map>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -70,16 +70,23 @@ class FocusManager::LinkMap
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
FocusManager* FocusManager::spInstance = NULL;
|
|
||||||
|
|
||||||
|
|
||||||
FocusManager& FocusManager::Instance (void)
|
FocusManager& FocusManager::Instance (void)
|
||||||
{
|
{
|
||||||
|
static FocusManager* spInstance = NULL;
|
||||||
|
|
||||||
if (spInstance == NULL)
|
if (spInstance == NULL)
|
||||||
{
|
{
|
||||||
::vos::OGuard aGuard (::Application::GetSolarMutex());
|
::osl::MutexGuard aGuard (::osl::Mutex::getGlobalMutex());
|
||||||
if (spInstance == NULL)
|
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;
|
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);
|
bool TransferFocus (::Window* pSource, const KeyCode& rCode);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static FocusManager* spInstance;
|
|
||||||
class LinkMap;
|
class LinkMap;
|
||||||
::std::auto_ptr<LinkMap> mpLinks;
|
::std::auto_ptr<LinkMap> mpLinks;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user