diff options
author | Michael Meeks <michael.meeks@novell.com> | 2011-07-25 18:08:29 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2011-07-25 18:08:29 +0100 |
commit | 0ee44dbd6f7921a70e2ddf039dc8a02b03129efd (patch) | |
tree | d66ccd92a86de700a00ae77db0350ea63820c3ec /basic | |
parent | 3ba288cc6c7c391b27b00b386f47500e7ead2dd1 (diff) |
fdo#39520 - turn DocBasicItems into an rtl::Static to improve shutdown on mac
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/classes/sb.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index fca2841bcaee..c21e2ca1dc7f 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -166,33 +166,33 @@ namespace { typedef ::rtl::Reference< DocBasicItem > DocBasicItemRef; typedef boost::unordered_map< const StarBASIC *, DocBasicItemRef > DocBasicItemMap; - // ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleInitDependencyMap; -static DocBasicItemMap GaDocBasicItems; +class GaDocBasicItems : public rtl::Static<DocBasicItemMap,GaDocBasicItems> {}; const DocBasicItem* lclFindDocBasicItem( const StarBASIC* pDocBasic ) { - DocBasicItemMap::iterator it = GaDocBasicItems.find( pDocBasic ); - return (it != GaDocBasicItems.end()) ? it->second.get() : 0; + DocBasicItemMap::iterator it = GaDocBasicItems::get().find( pDocBasic ); + DocBasicItemMap::iterator end = GaDocBasicItems::get().end(); + return (it != end) ? it->second.get() : 0; } void lclInsertDocBasicItem( StarBASIC& rDocBasic ) { - DocBasicItemRef& rxDocBasicItem = GaDocBasicItems[ &rDocBasic ]; + DocBasicItemRef& rxDocBasicItem = GaDocBasicItems::get()[ &rDocBasic ]; rxDocBasicItem.set( new DocBasicItem( rDocBasic ) ); rxDocBasicItem->startListening(); } void lclRemoveDocBasicItem( StarBASIC& rDocBasic ) { - DocBasicItemMap::iterator it = GaDocBasicItems.find( &rDocBasic ); - if( it != GaDocBasicItems.end() ) + DocBasicItemMap::iterator it = GaDocBasicItems::get().find( &rDocBasic ); + if( it != GaDocBasicItems::get().end() ) { it->second->stopListening(); - GaDocBasicItems.erase( it ); + GaDocBasicItems::get().erase( it ); } - DocBasicItemMap::iterator it_end = GaDocBasicItems.end(); - for( it = GaDocBasicItems.begin(); it != it_end; ++it ) + DocBasicItemMap::iterator it_end = GaDocBasicItems::get().end(); + for( it = GaDocBasicItems::get().begin(); it != it_end; ++it ) it->second->clearDependingVarsOnDelete( rDocBasic ); } |