From ef3d1d392351f5faf5c7d12e81afde5183337640 Mon Sep 17 00:00:00 2001 From: wangwenx190 <2546789017@qq.com> Date: Sun, 30 Jul 2017 22:23:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DPlayer=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E9=A2=84=E8=A7=88=E5=B0=8F=E7=AA=97=E5=90=8E?= =?UTF-8?q?=E5=85=B6=E8=A7=A3=E7=A0=81=E6=89=80=E9=9C=80=E7=9A=84=E9=A2=9D?= =?UTF-8?q?=E5=A4=96=E5=86=85=E5=AD=98=E4=B8=8D=E4=BC=9A=E5=9C=A8=E5=85=B6?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E5=90=8E=E9=87=8A=E6=94=BE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 鼠标离开TimeSlider后即删除m_preview窗口,其解码过程即刻停止,内存占用即可下降 --- examples/player/MainWindow.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/player/MainWindow.cpp b/examples/player/MainWindow.cpp index fb7cda4cb..81a668ebf 100644 --- a/examples/player/MainWindow.cpp +++ b/examples/player/MainWindow.cpp @@ -1333,8 +1333,18 @@ void MainWindow::onTimeSliderHover(int pos, int value) void MainWindow::onTimeSliderLeave() { - if (m_preview && m_preview->isVisible()) - m_preview->hide(); + /*if (m_preview && m_preview->isVisible()) + m_preview->hide();*/ + if (!m_preview) + { + return; + } + if (m_preview->isVisible()) + { + m_preview->close(); + } + delete m_preview; + m_preview = nullptr; } void MainWindow::handleError(const AVError &e)