Qt: Fix some frame viewer memory leaks
Vicki Pfau vi@endrift.com
Thu, 14 Jan 2021 23:13:35 -0800
1 files changed,
9 insertions(+),
0 deletions(-)
jump to
M
src/platform/qt/FrameView.cpp
→
src/platform/qt/FrameView.cpp
@@ -83,7 +83,12 @@
FrameView::~FrameView() { QMutexLocker locker(&m_mutex); *m_callbackLocker = false; + + if (m_nextFrame) { + m_controller->endVideoLog(true); + } if (m_vl) { + mCoreConfigDeinit(&m_vl->config); m_vl->deinit(m_vl); } }@@ -517,6 +522,9 @@ }
void FrameView::refreshVl() { QMutexLocker locker(&m_mutex); + if (m_currentFrame) { + m_currentFrame->close(m_currentFrame); + } m_currentFrame = m_nextFrame; m_nextFrame = VFileDevice::openMemory(); if (m_currentFrame) {@@ -536,6 +544,7 @@ if (!m_currentFrame) {
return; } if (m_vl) { + mCoreConfigDeinit(&m_vl->config); m_vl->deinit(m_vl); } m_vl = mCoreFindVF(m_currentFrame);