From: Alex Rousskov Date: Mon, 2 Jun 2014 05:16:35 +0000 (-0700) Subject: Do not register the same Cache Manager action more than once X-Git-Tag: SQUID_3_5_0_1~212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3c2ea0184198f66df3c2df9e916f51b617af50a;p=thirdparty%2Fsquid.git Do not register the same Cache Manager action more than once ... to avoid wrong mgr:menu output and the impression of a reconfigure memory leak. The old code was comparing action object pointers, which could not work, and was adding the same action on every reconfigure call for modules that register with Cache Manager during [re]configuration. We already have a working method for finding registered actions. Use it. --- diff --git a/src/cache_manager.cc b/src/cache_manager.cc index 66976cd916..4598b9d964 100644 --- a/src/cache_manager.cc +++ b/src/cache_manager.cc @@ -82,7 +82,7 @@ void CacheManager::registerProfile(const Mgr::ActionProfile::Pointer &profile) { Must(profile != NULL); - if (std::find(menu_.begin(), menu_.end(), profile) == menu_.end()) { + if (!CacheManager::findAction(profile->name)) { menu_.push_back(profile); debugs(16, 3, HERE << "registered profile: " << *profile); } else {