function is calling erase on the map container which will invalidate it. Hence, added guard calls.
Change-Id: I555895089d8dfa0a3a7f0d804dd5ccef8e4e1ece
Signed-off-by: abitha.s <abitha.s@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21097
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
activationLock.lock();
for (std::map< std::string, shared_ptr<BundleInfoInternal> >::iterator it = m_bundles.begin();
- it != m_bundles.end(); ++it)
+ it != m_bundles.end();)
{
+ auto next_itr = std::next (it, 1);
deactivateBundle(it->second);
unregisterBundle(it->second);
+ it = next_itr;
}
if (!m_mapServers.empty())