diff options
| author | Méven Car <[email protected]> | 2026-03-22 18:48:25 +0100 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2026-03-22 18:48:25 +0100 |
| commit | 4e5b14ad50dfc01041e748e3aca6072cbcf6498c (patch) | |
| tree | 361a53532007bc2a7e32189b833512a1d08865d3 /src/panels | |
| parent | 36734d7d57283c932f1feabe87fd0cf2fa905359 (diff) | |
panels/information: prevent memleak when closing mediawidget
Parent the QMediaPlayer and QAudioOutput so they can get deleted with
their parent.
Diffstat (limited to 'src/panels')
| -rw-r--r-- | src/panels/information/mediawidget.cpp | 4 |
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); |
