Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复切换显示内存泄漏问题 #561

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/backends/mpv/mpv_proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@

#include <xcb/xproto.h>
#include <xcb/xcb_aux.h>
#include <QX11Info>

Check warning on line 26 in src/backends/mpv/mpv_proxy.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QX11Info> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QLibrary>

Check warning on line 27 in src/backends/mpv/mpv_proxy.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QLibrary> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <va/va_x11.h>

Check warning on line 28 in src/backends/mpv/mpv_proxy.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <va/va_x11.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <malloc.h>

Check warning on line 29 in src/backends/mpv/mpv_proxy.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <malloc.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

namespace dmr {
using namespace mpv::qt;
Expand Down Expand Up @@ -1250,6 +1251,7 @@
{
QList<QString> canHwTypes;
if (dynamic_cast<PlayerEngine *>(m_pParentWidget)->getplaylist()->size() <= 0) return;
malloc_trim(0);
//bool bIsCanHwDec = HwdecProbe::get().isFileCanHwdec(_file.url(), canHwTypes);

if (DecodeMode::SOFTWARE == m_decodeMode) { //1.设置软解
Expand Down
3 changes: 3 additions & 0 deletions src/common/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@
#include "dbus_adpator.h"
#include "threadpool.h"
#include "vendor/movieapp.h"
#include "vendor/presenter.h"

Check warning on line 28 in src/common/mainwindow.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "vendor/presenter.h" not found.
#include "filefilter.h"

Check warning on line 29 in src/common/mainwindow.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "filefilter.h" not found.
#include "eventlogutils.h"

Check warning on line 30 in src/common/mainwindow.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: "eventlogutils.h" not found.
#include <malloc.h>

Check warning on line 31 in src/common/mainwindow.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <malloc.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

//#include <QtWidgets>
#include <QtDBus>

Check warning on line 34 in src/common/mainwindow.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QtDBus> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QtX11Extras>
#include <QX11Info>
#include <DLabel>
Expand Down Expand Up @@ -4524,6 +4525,7 @@
void MainWindow::sleepStateChanged(bool bSleep)
{
qInfo() << __func__ << bSleep;
malloc_trim(0);

//if (m_bStateInLock) { //休眠唤醒后会先执行锁屏操作,如果已经进行锁屏操作则忽略休眠唤醒信号
// m_bStartSleep = bSleep;
Expand All @@ -4546,6 +4548,7 @@
void MainWindow::lockStateChanged(bool bLock)
{
qInfo() << __func__ << bLock;
malloc_trim(0);
//锁屏退出投屏
if(bLock && m_pMircastShowWidget && m_pMircastShowWidget->isVisible()) {
slotExitMircast();
Expand Down
Loading