diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-05-30 12:24:42 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-05-30 16:00:35 +0200 |
commit | a6856795267509aaf0b4f59a9fb3a626411d1cb6 (patch) | |
tree | 1aec9b53493454e37b371ec9a5fa6b82be6016f5 /basic/source/classes | |
parent | 5b676a480a68f2ad7ceb107147a2ab3363b4d22d (diff) |
cid#1504574 Resource leak
make an owner for the PropertyMapEntries
Change-Id: Ie915a8a312f2b24488566814ad67fdeef89b5941
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135123
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'basic/source/classes')
-rw-r--r-- | basic/source/classes/propacc.cxx | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/basic/source/classes/propacc.cxx b/basic/source/classes/propacc.cxx index 06bba39073d7..4c948c3038af 100644 --- a/basic/source/classes/propacc.cxx +++ b/basic/source/classes/propacc.cxx @@ -54,17 +54,10 @@ Reference< XPropertySetInfo > SbPropertyValues::getPropertySetInfo() // create on demand? if (!m_xInfo.is()) { - uno::Sequence<beans::Property> props(m_aPropVals.size()); - for (size_t n = 0; n < m_aPropVals.size(); ++n) - { - Property &rProp = props.getArray()[n]; - const PropertyValue &rPropVal = m_aPropVals[n]; - rProp.Name = rPropVal.Name; - rProp.Handle = rPropVal.Handle; - rProp.Type = cppu::UnoType<void>::get(); - rProp.Attributes = 0; - } - m_xInfo.set(new ::comphelper::PropertySetInfo(props)); + assert(m_aPropInfos.empty()); + for (auto const& it : m_aPropVals) + m_aPropInfos.emplace_back(it.Name, it.Handle, cppu::UnoType<void>::get(), 0, 0); + m_xInfo.set(new ::comphelper::PropertySetInfo(m_aPropInfos)); } return m_xInfo; } |