Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hello,

Cppcheck reported this:
cppuhelper/source/servicemanager.cxx
1578    eraseDereference        error   Iterator 'i' used after element has been erased.

(+ this but I don't know if we can do something:
1216    unusedScopedObject      error   Instance of 'Parser' object is destroyed
immediately.
1390    unusedScopedObject      error   Instance of 'Parser' object is destroyed
immediately)

Here are the lines:
   1563         Data::DynamicImplementations::iterator i(
   1564             data_.dynamicImplementations.find(factoryInfo));
   1565         if (i == data_.dynamicImplementations.end()) {
   1566             return isDisposed();
   1567         }
   1568         assert(i->second.get() != 0);
   1569         clear = i->second;
   1570         //TODO: The below leaves data_ in an inconsistent state upon
exceptions:
   1571         removeFromImplementationMap(
   1572             &data_.services, i->second->info->services, i->second);
   1573         removeFromImplementationMap(
   1574             &data_.singletons, i->second->info->singletons,
i->second);
   1575         if (!i->second->info->name.isEmpty()) {
   1576             data_.namedImplementations.erase(i->second->info->name);
   1577         }
   1578         data_.dynamicImplementations.erase(i);
   1579         if (removeListener) {
   1580             comp = i->second->component;
   1581         }
see
http://opengrok.libreoffice.org/xref/core/cppuhelper/source/servicemanager.cxx#1554

Any idea how this should be changed?

Julien



--
View this message in context: 
http://nabble.documentfoundation.org/Cppcheck-Iterator-i-used-after-element-has-been-erased-in-servicemanager-cxx-cppuhelper-module-tp4037867.html
Sent from the Dev mailing list archive at Nabble.com.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.