┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMéven Car <[email protected]>2026-03-22 18:48:25 +0100
committerMéven Car <[email protected]>2026-03-22 18:48:25 +0100
commit4e5b14ad50dfc01041e748e3aca6072cbcf6498c (patch)
tree361a53532007bc2a7e32189b833512a1d08865d3
parent36734d7d57283c932f1feabe87fd0cf2fa905359 (diff)
panels/information: prevent memleak when closing mediawidget
Parent the QMediaPlayer and QAudioOutput so they can get deleted with their parent.
-rw-r--r--src/panels/information/mediawidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/panels/information/mediawidget.cpp b/src/panels/information/mediawidget.cpp
index fd91e9a86..54a6d7fe7 100644
--- a/src/panels/information/mediawidget.cpp
+++ b/src/panels/information/mediawidget.cpp
@@ -302,8 +302,8 @@ void MediaWidget::initPlayer()
{
if (!m_player) {
initLayout();
- m_player = new QMediaPlayer;
- m_player->setAudioOutput(new QAudioOutput);
+ m_player = new QMediaPlayer(this);
+ m_player->setAudioOutput(new QAudioOutput(m_player));
m_videoWidget = new EmbeddedVideoPlayer(this);
m_videoWidget->setCursor(Qt::PointingHandCursor);