From c17928435887055d52268337dee64afc6449cfe5 Mon Sep 17 00:00:00 2001 From: ut001910 Date: Fri, 17 Jan 2025 14:02:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复切换显示内存泄漏问题 Bug: https://pms.uniontech.com/bug-view-301043.html Log: 修复切换显示内存泄漏问题 --- src/backends/mpv/mpv_proxy.cpp | 2 ++ src/common/mainwindow.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/backends/mpv/mpv_proxy.cpp b/src/backends/mpv/mpv_proxy.cpp index cb33aaf0..c325daab 100644 --- a/src/backends/mpv/mpv_proxy.cpp +++ b/src/backends/mpv/mpv_proxy.cpp @@ -26,6 +26,7 @@ #include #include #include +#include namespace dmr { using namespace mpv::qt; @@ -1250,6 +1251,7 @@ void MpvProxy::refreshDecode() { QList canHwTypes; if (dynamic_cast(m_pParentWidget)->getplaylist()->size() <= 0) return; + malloc_trim(0); //bool bIsCanHwDec = HwdecProbe::get().isFileCanHwdec(_file.url(), canHwTypes); if (DecodeMode::SOFTWARE == m_decodeMode) { //1.设置软解 diff --git a/src/common/mainwindow.cpp b/src/common/mainwindow.cpp index 3ddb3846..4dd64dac 100644 --- a/src/common/mainwindow.cpp +++ b/src/common/mainwindow.cpp @@ -28,6 +28,7 @@ #include "vendor/presenter.h" #include "filefilter.h" #include "eventlogutils.h" +#include //#include #include @@ -4524,6 +4525,7 @@ void MainWindow::diskRemoved(QString strDiskName) void MainWindow::sleepStateChanged(bool bSleep) { qInfo() << __func__ << bSleep; + malloc_trim(0); //if (m_bStateInLock) { //休眠唤醒后会先执行锁屏操作,如果已经进行锁屏操作则忽略休眠唤醒信号 // m_bStartSleep = bSleep; @@ -4546,6 +4548,7 @@ void MainWindow::sleepStateChanged(bool bSleep) void MainWindow::lockStateChanged(bool bLock) { qInfo() << __func__ << bLock; + malloc_trim(0); //锁屏退出投屏 if(bLock && m_pMircastShowWidget && m_pMircastShowWidget->isVisible()) { slotExitMircast();