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

use a non-leaky singleton

üst 7c0b65c7
...@@ -33,20 +33,19 @@ ...@@ -33,20 +33,19 @@
#i73788# #i73788#
*/ */
SwRetrievedInputStreamDataManager* SwRetrievedInputStreamDataManager::mpManager = 0;
SwRetrievedInputStreamDataManager::tDataKey SwRetrievedInputStreamDataManager::mnNextKeyValue = 1; SwRetrievedInputStreamDataManager::tDataKey SwRetrievedInputStreamDataManager::mnNextKeyValue = 1;
osl::Mutex SwRetrievedInputStreamDataManager::maGetManagerMutex;
SwRetrievedInputStreamDataManager& SwRetrievedInputStreamDataManager::GetManager() namespace
{ {
osl::MutexGuard aGuard(maGetManagerMutex); class theSwRetrievedInputStreamDataManager :
public rtl::Static< SwRetrievedInputStreamDataManager, theSwRetrievedInputStreamDataManager>
if ( mpManager == 0 )
{ {
mpManager = new SwRetrievedInputStreamDataManager(); };
} }
return *mpManager; SwRetrievedInputStreamDataManager& SwRetrievedInputStreamDataManager::GetManager()
{
return theSwRetrievedInputStreamDataManager::get();
} }
SwRetrievedInputStreamDataManager::tDataKey SwRetrievedInputStreamDataManager::ReserveData( SwRetrievedInputStreamDataManager::tDataKey SwRetrievedInputStreamDataManager::ReserveData(
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <tools/link.hxx> #include <tools/link.hxx>
#include <sal/types.h> #include <sal/types.h>
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <rtl/instance.hxx>
#include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XInputStream.hpp>
...@@ -93,14 +94,14 @@ class SwRetrievedInputStreamDataManager ...@@ -93,14 +94,14 @@ class SwRetrievedInputStreamDataManager
private: private:
static SwRetrievedInputStreamDataManager* mpManager;
static tDataKey mnNextKeyValue; static tDataKey mnNextKeyValue;
static osl::Mutex maGetManagerMutex;
osl::Mutex maMutex; osl::Mutex maMutex;
std::map< tDataKey, tData > maInputStreamData; std::map< tDataKey, tData > maInputStreamData;
template<typename T, typename Unique> friend class rtl::Static;
SwRetrievedInputStreamDataManager() SwRetrievedInputStreamDataManager()
{ {
}; };
......
...@@ -1162,9 +1162,6 @@ sdr::table::SdrTableObj::getColumnCount() const ...@@ -1162,9 +1162,6 @@ sdr::table::SdrTableObj::getColumnCount() const
sdr::table::SdrTableObj::getRowCount() const sdr::table::SdrTableObj::getRowCount() const
sfx2::TaskPaneWrapper::GetChildWindowId() sfx2::TaskPaneWrapper::GetChildWindowId()
slideshow::internal::DrawShapeSubsetting::reset(slideshow::internal::DocTreeNode const&, boost::shared_ptr<GDIMetaFile> const&) slideshow::internal::DrawShapeSubsetting::reset(slideshow::internal::DocTreeNode const&, boost::shared_ptr<GDIMetaFile> const&)
std::__cxx1998::map<rtl::OUString, OutputStorageWrapper_Impl*, OUStringLess, std::allocator<std::pair<rtl::OUString const, OutputStorageWrapper_Impl*> > >::~map()
std::__cxx1998::map<rtl::OUString, binfilter::OutputStorageWrapper_Impl*, binfilter::OUStringLess, std::allocator<std::pair<rtl::OUString const, binfilter::OutputStorageWrapper_Impl*> > >::~map()
std::__cxx1998::map<unsigned long, SwRetrievedInputStreamDataManager::tData, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, SwRetrievedInputStreamDataManager::tData> > >::~map()
std::__cxx1998::multimap<_xmlNode*, com::sun::star::uno::Reference<com::sun::star::xml::dom::events::XEventListener>, std::less<_xmlNode*>, std::allocator<std::pair<_xmlNode* const, com::sun::star::uno::Reference<com::sun::star::xml::dom::events::XEventListener> > > >::~multimap() std::__cxx1998::multimap<_xmlNode*, com::sun::star::uno::Reference<com::sun::star::xml::dom::events::XEventListener>, std::less<_xmlNode*>, std::allocator<std::pair<_xmlNode* const, com::sun::star::uno::Reference<com::sun::star::xml::dom::events::XEventListener> > > >::~multimap()
std::__cxx1998::vector<CntHTTPCookie*, std::allocator<CntHTTPCookie*> >::~vector() std::__cxx1998::vector<CntHTTPCookie*, std::allocator<CntHTTPCookie*> >::~vector()
std::__cxx1998::vector<OrderedEntry*, std::allocator<OrderedEntry*> >::~vector() std::__cxx1998::vector<OrderedEntry*, std::allocator<OrderedEntry*> >::~vector()
......
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