From 05e13b51b74b3662323255ceea0ef3c4675050e1 Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Tue, 3 Jun 2014 01:10:53 -0600 Subject: [PATCH] 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. --- src/cache_manager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { -- 2.47.2