summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-03-10 16:30:33 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-03-10 17:23:34 +0000
commit4b5c8f4826173578d6d088eab01b9816546785d3 (patch)
tree97ae97ef645dab6785fb984fe011da5b25b691bb /linguistic
parent23facc76055a278f81acdfe5942965dc50f50e25 (diff)
Fix leak, we own these pointers, so release them.
Diffstat (limited to 'linguistic')
-rw-r--r--linguistic/source/lngsvcmgr.cxx10
-rw-r--r--linguistic/source/lngsvcmgr.hxx4
2 files changed, 8 insertions, 6 deletions
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 8bdfd2d3dada..487f29ad3005 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -254,7 +254,7 @@ void LngSvcMgr::SetAvailableCfgServiceLists( LinguDispatcher &rDispatcher,
size_t nAvailSvcs = rAvailSvcs.size();
for (size_t m = 0; m < nAvailSvcs; ++m)
{
- const SvcInfo &rSvcInfo = *rAvailSvcs[m];
+ const SvcInfo &rSvcInfo = rAvailSvcs[m];
if (rSvcInfo.aSvcImplName == pImplNames[k] &&
rSvcInfo.HasLanguage( nLang ))
{
@@ -1437,13 +1437,13 @@ uno::Sequence< OUString > SAL_CALL
USHORT nCnt = 0;
LanguageType nLanguage = LocaleToLanguage( rLocale );
- for (size_t i = 0; i < nMaxCnt; ++i)
+ for (size_t i = 0; i < nMaxCnt; ++i)
{
- const SvcInfo *pInfo = (*pInfoArray)[i];
+ const SvcInfo &rInfo = (*pInfoArray)[i];
if (LANGUAGE_NONE == nLanguage
- || (pInfo && pInfo->HasLanguage( nLanguage )))
+ || rInfo.HasLanguage( nLanguage ))
{
- pImplName[ nCnt++ ] = pInfo->aSvcImplName;
+ pImplName[ nCnt++ ] = rInfo.aSvcImplName;
}
}
diff --git a/linguistic/source/lngsvcmgr.hxx b/linguistic/source/lngsvcmgr.hxx
index a7057daf079f..9140a0f5ca8d 100644
--- a/linguistic/source/lngsvcmgr.hxx
+++ b/linguistic/source/lngsvcmgr.hxx
@@ -41,6 +41,8 @@
#include <com/sun/star/linguistic2/XAvailableLocales.hpp>
#include <unotools/configitem.hxx>
+#include <boost/ptr_container/ptr_vector.hpp>
+
#include "misc.hxx"
#include "defs.hxx"
@@ -105,7 +107,7 @@ class LngSvcMgr :
LngSvcMgrListenerHelper * pListenerHelper;
- typedef std::vector< SvcInfo * > SvcInfoArray;
+ typedef boost::ptr_vector< SvcInfo > SvcInfoArray;
SvcInfoArray * pAvailSpellSvcs;
SvcInfoArray * pAvailGrammarSvcs;
SvcInfoArray * pAvailHyphSvcs;