[Libreoffice-commits] .: unoxml/source unusedcode.easy

Caolán McNamara caolan at kemper.freedesktop.org
Sat Jul 28 07:46:18 PDT 2012


 unoxml/source/events/eventdispatcher.cxx |   10 ++++++++++
 unoxml/source/events/eventdispatcher.hxx |    2 ++
 unusedcode.easy                          |    1 -
 3 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 26a21cd45bd499c029f3d0344410dc808761987e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jul 28 15:44:13 2012 +0100

    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

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()


More information about the Libreoffice-commits mailing list