From 412ebc00ca3ccbbb6a60094a67d1402376298c85 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 3 Feb 2010 15:55:00 +0100 Subject: CCpp analyzer: change duphash calculation to group minor versions together Signed-off-by: Denys Vlasenko --- src/Daemon/PluginManager.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/Daemon') diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp index c552880..273cceb 100644 --- a/src/Daemon/PluginManager.cpp +++ b/src/Daemon/PluginManager.cpp @@ -159,16 +159,15 @@ void CPluginManager::UnLoadPlugins() CPlugin* CPluginManager::LoadPlugin(const char *pName, bool enabled_only) { - map_string_t plugin_info; - - plugin_info["Name"] = pName; - map_plugin_t::iterator it_plugin = m_mapPlugins.find(pName); if (it_plugin != m_mapPlugins.end()) { return it_plugin->second; /* ok */ } + map_string_t plugin_info; + plugin_info["Name"] = pName; + const char *conf_name = pName; if (strncmp(pName, "Kerneloops", sizeof("Kerneloops")-1) == 0) { -- cgit From 80f3d6ddc8ed631e463c80c5d7c98d03c7b74f57 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Wed, 3 Feb 2010 23:05:11 +0100 Subject: swapped lines, iterator is not defined after erase() is called - and this makes valgrind unhappy --- src/Daemon/PluginManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Daemon') diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp index 273cceb..15e9bee 100644 --- a/src/Daemon/PluginManager.cpp +++ b/src/Daemon/PluginManager.cpp @@ -261,8 +261,8 @@ void CPluginManager::UnLoadPlugin(const char *pName) m_mapPlugins.erase(it_plugin); } log("UnRegistered %s plugin %s", plugin_type_str[it_module->second->GetType()], pName); - m_mapLoadedModules.erase(it_module); delete it_module->second; + m_mapLoadedModules.erase(it_module); } } -- cgit From 148e19105577984a7fa3b6da97ec9ba565a9cfa7 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Thu, 4 Feb 2010 10:13:31 +0100 Subject: comments --- src/Daemon/Daemon.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Daemon') diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 5bcbe23..185ff7f 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -294,7 +294,7 @@ static void FindNewDumps(const char* pPath) struct stat stats; DIR *dp; vector_string_t dirs; - // get potential unsaved debugdumps + /* Get all debugdump directories in the pPath directory. */ dp = opendir(pPath); if (dp == NULL) { @@ -305,7 +305,7 @@ static void FindNewDumps(const char* pPath) while ((ep = readdir(dp))) { if (dot_or_dotdot(ep->d_name)) - continue; + continue; /* skip "." and ".." */ std::string dname = ssprintf("%s/%s", pPath, ep->d_name); if (lstat(dname.c_str(), &stats) == 0) { @@ -317,6 +317,7 @@ static void FindNewDumps(const char* pPath) } closedir(dp); + // get potential unsaved debugdumps vector_string_t::iterator itt = dirs.begin(); for (; itt != dirs.end(); ++itt) { -- cgit