Skip to content

Commit

Permalink
修复Player出现视频预览小窗后其解码所需的额外内存不会在其关闭后释放的问题
Browse files Browse the repository at this point in the history
鼠标离开TimeSlider后即删除m_preview窗口,其解码过程即刻停止,内存占用即可下降
  • Loading branch information
wangwenx190 authored Jul 30, 2017
1 parent cda61b2 commit ef3d1d3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions examples/player/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ef3d1d3

Please sign in to comment.