Commit f3e0752f authored by Fatih Uzunoğlu's avatar Fatih Uzunoğlu Committed by Hugo Beauzée-Luyssen
Browse files

qml: fix segmentation fault on component destruction

intends to be a temporary solution for #25599, #25776.
parent a8f165a0
......@@ -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)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment