[vlc-commits] [Git][videolan/vlc][master] qml: fix null access due to `Qt.callLater`

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Nov 17 12:13:31 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
810ae8d0 by Pierre Lamot at 2025-11-17T11:19:24+00:00
qml: fix null access due to `Qt.callLater`

fix warning "TypeError: Value is null and could not be converted to an object
(exception occurred during delayed function evaluation)"

When using a lambda with `callLater`, QML doesn't check with that used objects
exists, this can be problematic during the destruction phase. Using an object
function fix the issue (observed with Qt 6.2 and 6.8)

- - - - -


1 changed file:

- modules/gui/qt/widgets/qml/FadingEdge.qml


Changes:

=====================================
modules/gui/qt/widgets/qml/FadingEdge.qml
=====================================
@@ -199,20 +199,24 @@ Item {
 
             onBeginningFadeSizeChanged: {
                 if (!beginningFadeBehavior.enabled) {
-                    Qt.callLater(() => {
-                        beginningFadeBehavior.enabled = true
-                    })
+                    Qt.callLater(effect._enableBeginningFadeBehavior)
                 }
             }
 
             onEndFadeSizeChanged: {
                 if (!endFadeBehavior.enabled) {
-                    Qt.callLater(() => {
-                        endFadeBehavior.enabled = true
-                    })
+                    Qt.callLater(effect._enableEndFadeBehavior)
                 }
             }
 
+            function _enableBeginningFadeBehavior() {
+                beginningFadeBehavior.enabled = true
+            }
+
+            function _enableEndFadeBehavior() {
+                endFadeBehavior.enabled = true
+            }
+
             Component.onCompleted: {
                 console.assert(shaderEffectSource.shaderEffect === null)
                 shaderEffectSource.shaderEffect = this



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/810ae8d0bc235f3b6ff0b282096eba6f9c62ae25

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/810ae8d0bc235f3b6ff0b282096eba6f9c62ae25
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list