Browse Source

Revert "qml: fix segmentation fault on component destruction"

This reverts commit f3e0752f50.
pull/162/head
Fatih Uzunoglu 3 years ago
committed by Jean-Baptiste Kempf
parent
commit
a4f29f92d1
  1. 27
      modules/gui/qt/widgets/qml/KeyNavigableTableView.qml

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

@ -155,8 +155,6 @@ FocusScope {
availableRowWidthUpdater.enqueueUpdate()
}
Component.onDestruction: _qtAvoidSectionUpdate()
on_CurrentAvailableRowWidthChanged: if (_ready) availableRowWidthUpdater.enqueueUpdate()
// Functions
@ -184,31 +182,6 @@ FocusScope {
// Private
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
}
// Childs
Timer {

Loading…
Cancel
Save