Skip to content

Commit

Permalink
GUI: fix double-free on capture stop/application exit
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Gervais <[email protected]>
  • Loading branch information
g-maxime committed Apr 6, 2024
1 parent 12ceda7 commit 2bea63d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Source/GUI/dvrescue/dvrescue/mediaplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,10 @@ void MediaPlayer::setBuffer(QIODevice* newBuffer)
{
if (m_buffer.get() == newBuffer)
return;
m_buffer.reset(newBuffer);

m_buffer.reset(newBuffer, [](QObject*){}); // NoDeleter
// RAW pointer is owned by the QML engine
// and deleted outside of the shared pointer

QSharedPointer<QAVIODevice> dev(new QAVIODevice(m_buffer));

Expand Down

0 comments on commit 2bea63d

Please sign in to comment.