aboutsummaryrefslogtreecommitdiffstats
path: root/testing/qt-creator/fix-malloc-trim.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/qt-creator/fix-malloc-trim.patch')
-rw-r--r--testing/qt-creator/fix-malloc-trim.patch20
1 files changed, 9 insertions, 11 deletions
diff --git a/testing/qt-creator/fix-malloc-trim.patch b/testing/qt-creator/fix-malloc-trim.patch
index e699c3021ec..2261b0519d9 100644
--- a/testing/qt-creator/fix-malloc-trim.patch
+++ b/testing/qt-creator/fix-malloc-trim.patch
@@ -1,13 +1,11 @@
-diff --git a/src/app/main.cpp b/src/app/main.cpp
-index 248fa8efef..4c27f65625 100644
---- a/src/app/main.cpp
-+++ b/src/app/main.cpp
-@@ -782,7 +782,7 @@ int main(int argc, char **argv)
- // shutdown plugin manager on the exit
- QObject::connect(&app, &QCoreApplication::aboutToQuit, &pluginManager, &PluginManager::shutdown);
-
+--- a/src/plugins/coreplugin/icore.cpp
++++ b/src/plugins/coreplugin/icore.cpp
+@@ -1274,7 +1274,7 @@
+ m_trimTimer.setSingleShot(true);
+ m_trimTimer.setInterval(60000);
+ // glibc may not actually free memory in free().
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_LINUX) && defined(__GLIBC__)
- class MemoryTrimmer : public QObject
- {
- public:
+ connect(&m_trimTimer, &QTimer::timeout, this, [] { malloc_trim(0); });
+ #endif
+ }