diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-02-17 11:13:53 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-02-17 11:13:53 +0100 |
commit | 80d81b40a1915eec599fc7004698ff113e5bb47f (patch) | |
tree | 20ffc47834f2d953f42331bab7a84b50fa204a8a /cppuhelper | |
parent | a71946505b853ca3db7fd4c3a7df7bfc62626ed2 (diff) |
cppcheck: Iterator i used after element has been erased
Change-Id: Id8eb6a475dafcaddc98ddc48627fa8090e91cf4f
Diffstat (limited to 'cppuhelper')
-rw-r--r-- | cppuhelper/source/servicemanager.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx index dcb7af9c7bca..ce4bf4627025 100644 --- a/cppuhelper/source/servicemanager.cxx +++ b/cppuhelper/source/servicemanager.cxx @@ -1567,6 +1567,9 @@ bool cppuhelper::ServiceManager::removeLegacyFactory( } assert(i->second.get() != 0); clear = i->second; + if (removeListener) { + comp = i->second->component; + } //TODO: The below leaves data_ in an inconsistent state upon exceptions: removeFromImplementationMap( &data_.services, i->second->info->services, i->second); @@ -1576,9 +1579,6 @@ bool cppuhelper::ServiceManager::removeLegacyFactory( data_.namedImplementations.erase(i->second->info->name); } data_.dynamicImplementations.erase(i); - if (removeListener) { - comp = i->second->component; - } } if (comp.is()) { removeEventListenerFromComponent(comp); |