| author | Caolán McNamara <caolanm@redhat.com> | 2012-07-28 14:44:13 (GMT) |
|---|---|---|
| committer | Caolán McNamara <caolanm@redhat.com> | 2012-07-28 14:45:36 (GMT) |
| commit | 26a21cd45bd499c029f3d0344410dc808761987e (patch) (side-by-side diff) | |
| tree | 9f1691700c87d9385df83ad83065ed7ac5336101 | |
| parent | 351af6e43636ed581c963582bcf58a00faf04f36 (diff) | |
| download | core-26a21cd45bd499c029f3d0344410dc808761987e.zip core-26a21cd45bd499c029f3d0344410dc808761987e.tar.gz | |
callcatcher: unused dtor->fix leak
The other option I suppose is that in CEventDispatcher::removeListener when a
map becomes empty then delete the map
Change-Id: Icb108e3beb9eb7ce7f04f9e49b24e9cc77830b5d
| -rw-r--r-- | unoxml/source/events/eventdispatcher.cxx | 10 | ||||
| -rw-r--r-- | unoxml/source/events/eventdispatcher.hxx | 2 | ||||
| -rwxr-xr-x | unusedcode.easy | 1 |
3 files changed, 12 insertions, 1 deletions
diff --git a/unoxml/source/events/eventdispatcher.cxx b/unoxml/source/events/eventdispatcher.cxx index 70da837..665815b 100644 --- a/unoxml/source/events/eventdispatcher.cxx +++ b/unoxml/source/events/eventdispatcher.cxx @@ -74,6 +74,16 @@ namespace DOM { namespace events { } } + CEventDispatcher::~CEventDispatcher() + { + // delete the multimaps for the various types + for (TypeListenerMap::iterator aI = m_CaptureListeners.begin(); aI != m_CaptureListeners.end(); ++aI) + delete aI->second; + + for (TypeListenerMap::iterator aI = m_TargetListeners.begin(); aI != m_TargetListeners.end(); ++aI) + delete aI->second; + } + void CEventDispatcher::callListeners( TypeListenerMap const& rTMap, xmlNodePtr const pNode, diff --git a/unoxml/source/events/eventdispatcher.hxx b/unoxml/source/events/eventdispatcher.hxx index 4798277..cb21701 100644 --- a/unoxml/source/events/eventdispatcher.hxx +++ b/unoxml/source/events/eventdispatcher.hxx @@ -79,6 +79,8 @@ public: xmlNodePtr const pNode, Reference<XNode> const& xNode, Reference< XEvent > const& xEvent) const; + + ~CEventDispatcher(); }; }} diff --git a/unusedcode.easy b/unusedcode.easy index 10f7163..7705940 100755 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -175,7 +175,6 @@ sd::LeftDrawPaneShell::RegisterInterface(SfxModule*) sd::LeftImpressPaneShell::RegisterInterface(SfxModule*) sd::ToolPanelPaneShell::RegisterInterface(SfxModule*) sd::ViewShellBase::RegisterFactory(unsigned short) -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<OrderedEntry*, std::allocator<OrderedEntry*> >::~vector() std::__cxx1998::vector<SfxFilter*, std::allocator<SfxFilter*> >::~vector() std::__cxx1998::vector<SfxItemDesruptor_Impl*, std::allocator<SfxItemDesruptor_Impl*> >::~vector() |
