all repos — mgba @ fe4d4f986f2809c58dad0988929363daa5072e74

mGBA Game Boy Advance Emulator

Qt: Fix some frame viewer memory leaks
Vicki Pfau vi@endrift.com
Thu, 14 Jan 2021 23:13:35 -0800
commit

fe4d4f986f2809c58dad0988929363daa5072e74

parent

3d4faa41e281ff042451032190b3191af2737d5a

1 files changed, 9 insertions(+), 0 deletions(-)

jump to
M src/platform/qt/FrameView.cppsrc/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);