From f2e4e3f486806f985491038841a64cfce5cb9179 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Tue, 3 Nov 2015 06:51:57 +0200 Subject: [PATCH] kdecore: limit standard directories cache to 10000 entries this also fixes a strange bug that I originally tought that it's an RPATH issues but it turns out that this is some kind of mutex-lock issue. to be more interesting this bug does not occur when the NDEBUG conditionals are removed or if they are unconditionalized, the first observation leads me to think that this is compiler bug and the second that it's mutex-lock issue that is resolved because some code in KDebug and/or QDebug (i've tried with it too) locks/unlockes/detaches/does some voodoo that overcomes the bug. in any case it's hard for me to pin-point the problem so if anyone can look into it that would be great, for now this change will do Signed-off-by: Ivailo Monev --- kdecore/kernel/kstandarddirs.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/kdecore/kernel/kstandarddirs.cpp b/kdecore/kernel/kstandarddirs.cpp index d8e88c14..ecc079d3 100644 --- a/kdecore/kernel/kstandarddirs.cpp +++ b/kdecore/kernel/kstandarddirs.cpp @@ -553,22 +553,13 @@ bool KStandardDirs::exists(const QString &fullPath) const bool KStandardDirs::KStandardDirsPrivate::exists(const QString &fullPath) { - Q_UNUSED(max_file_info); -#if 0 if(m_infocache.count() == max_file_info) { m_infocache.clear(); } -#endif QFileInfo fileinfo; if(m_infocache.contains(fullPath)) { -#ifndef NDEBUG - kDebug(180) << "cached exists check on" << fullPath; -#endif fileinfo = m_infocache.value(fullPath); } else { -#ifndef NDEBUG - kDebug(180) << "new exists check on" << fullPath; -#endif fileinfo = QFileInfo(fullPath); m_infocache.insert(fullPath, fileinfo); }