summaryrefslogtreecommitdiff
path: root/sfx2/source/bastyp
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-05-19 15:21:04 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-05-19 16:36:19 +0100
commitc5e114c00cccb1b98dac7cb96de21e4ba53647c2 (patch)
treeb01faeeeb5ae6023b772d4d3c42b64ab6f63621b /sfx2/source/bastyp
parent48ea499aa9c7fc05125be9bcc9342de4caa01b1c (diff)
valgrind: memory leak
Change-Id: Ica30df49caf79117bbce36ec461ec5ef37bef20c
Diffstat (limited to 'sfx2/source/bastyp')
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx24
1 files changed, 20 insertions, 4 deletions
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 2105c666a206..072ded5cf9e3 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -112,7 +112,25 @@ using namespace com::sun::star;
namespace
{
class theSfxFilterListener : public rtl::Static<SfxFilterListener, theSfxFilterListener> {};
- class theSfxFilterArray : public rtl::Static<SfxFilterList_Impl, theSfxFilterArray > {};
+ class SfxFilterArray
+ {
+ SfxFilterList_Impl aList;
+ public:
+ ~SfxFilterArray()
+ {
+ SfxFilterList_Impl::iterator aEnd = aList.end();
+ for (SfxFilterList_Impl::iterator aI = aList.begin(); aI != aEnd; ++aI)
+ {
+ SfxFilter *pFilter = *aI;
+ delete pFilter;
+ }
+ }
+ SfxFilterList_Impl *getList()
+ {
+ return &aList;
+ }
+ };
+ class theSfxFilterArray : public rtl::Static<SfxFilterArray, theSfxFilterArray > {};
}
static SfxFilterList_Impl* pFilterArr = 0;
@@ -120,17 +138,15 @@ static bool bFirstRead = true;
static void CreateFilterArr()
{
- pFilterArr = &theSfxFilterArray::get();
+ pFilterArr = theSfxFilterArray::get().getList();
theSfxFilterListener::get();
}
-
inline OUString ToUpper_Impl( const OUString &rStr )
{
return SvtSysLocale().GetCharClass().uppercase( rStr );
}
-
class SfxFilterContainer_Impl
{
public: