From: Alex Rousskov Date: Tue, 3 Jun 2014 07:10:53 +0000 (-0600) Subject: Do not register the same Cache Manager action more than once X-Git-Tag: SQUID_3_4_6~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05e13b51b74b3662323255ceea0ef3c4675050e1;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 9d881b5cf4..b66d8d6503 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 {