[vlc-commits] [Git][videolan/vlc][master] qml: fix segmentation fault on component destruction

Hugo Beauzée-Luyssen gitlab at videolan.org
Fri Jun 4 08:38:18 UTC 2021



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
f3e0752f by Fatih Uzunoglu at 2021-06-04T08:05:30+00:00
qml: fix segmentation fault on component destruction

intends to be a temporary solution for #25599, #25776.

- - - - -


1 changed file:

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


Changes:

=====================================
modules/gui/qt/widgets/qml/KeyNavigableTableView.qml
=====================================
@@ -95,6 +95,35 @@ NavigableFocusScope {
 
     Accessible.role: Accessible.Table
 
+    function _qtAvoidSectionUpdate() {
+        // Qt SEG. FAULT WORKAROUND
+
+        // There exists a Qt bug that tries to access null
+        // pointer while updating sections. Qt does not
+        // check if `QQmlEngine::contextForObject(sectionItem)->parentContext()`
+        // is null and when it's null which might be the case for
+        // views during destruction it causes segmentation fault.
+
+        // As a workaround, when section delegate is set to null
+        // during destruction, Qt does not proceed with updating
+        // the sections so null pointer access is avoided. Updating
+        // sections during destruction should not make sense anyway.
+
+        // Setting section delegate to null seems to has no
+        // negative impact and safely could be used as a fix.
+        // However, the problem lying beneath prevails and
+        // should be taken care of sooner than later.
+
+        // Affected Qt versions are 5.11.3, and 5.15.2 (not
+        // limited).
+
+        section.delegate = null
+    }
+
+    Component.onDestruction: {
+        _qtAvoidSectionUpdate()
+    }
+
     function positionViewAtIndex(index, mode) {
         view.positionViewAtIndex(index, mode)
     }



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

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




More information about the vlc-commits mailing list