[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: fix MediaCover handler being called after object is destroyed in GridItem

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sat May 30 12:02:26 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
5e54af67 by Pierre Lamot at 2026-05-30T13:51:34+02:00
qml: fix MediaCover handler being called after object is destroyed in GridItem

At least with Qt 6.2 `connect` doesn't know when target is destroyed this lead
to "use after free" like scenario.

```
qrc:/qt/qml/VLC/Widgets/MediaCover.qml:94: TypeError: Value is null and could not be converted to an object
qrc:/qt/qml/VLC/Widgets/MediaCover.qml:86: Error: Invalid write to global property "_loadTimeout"
```

- - - - -
da358f42 by Pierre Lamot at 2026-05-30T13:51:34+02:00
qml: fix MediaCover handler being called after object is destroyed in TableView

At least with Qt 6.2 `connect` doesn't know when target is destroyed this lead
to "use after free" like scenario.

```
qrc:/qt/qml/VLC/Widgets/MediaCover.qml:94: TypeError: Value is null and could not be converted to an object
qrc:/qt/qml/VLC/Widgets/MediaCover.qml:86: Error: Invalid write to global property "_loadTimeout"
```

- - - - -


2 changed files:

- modules/gui/qt/widgets/qml/GridItem.qml
- modules/gui/qt/widgets/qml/TableColumns.qml


Changes:

=====================================
modules/gui/qt/widgets/qml/GridItem.qml
=====================================
@@ -303,10 +303,16 @@ T.ItemDelegate {
                 root.playClicked()
             }
 
-            Component.onCompleted: {
-                root.GridView.reused.connect(picture.reinitialize)
-                root.GridView.pooled.connect(picture.releaseResources)
-            }
+            Connections {
+                target: root.GridView
+
+                function onReused() {
+                    picture.reinitialize()
+                }
+                function onPooled() {
+                    picture.releaseResources()
+                }
+             }
 
             DefaultShadow {
                 id: unselectedShadow


=====================================
modules/gui/qt/widgets/qml/TableColumns.qml
=====================================
@@ -119,10 +119,16 @@ Item {
                 radius: root.titleCover_radius
                 color: titleDel.colorContext.bg.secondary
 
-                Component.onCompleted: {
-                    console.assert(titleDel.delegate)
-                    titleDel.delegate.ListView.reused.connect(cover.reinitialize)
-                    titleDel.delegate.ListView.pooled.connect(cover.releaseResources)
+
+                Connections {
+                    target: titleDel.delegate.ListView
+
+                    function onReused() {
+                        cover.reinitialize()
+                    }
+                    function onPooled() {
+                        cover.releaseResources()
+                    }
                 }
 
                 imageOverlay: Item {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/652a15cde1b8370e3321dea65aa4eb37d4eb7f4c...da358f42b8d90c8ae62bd2ca7267b6fb6fab939b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/652a15cde1b8370e3321dea65aa4eb37d4eb7f4c...da358f42b8d90c8ae62bd2ca7267b6fb6fab939b
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list