cscarney / syndic

Convergent feed reader for Plasma and Android
12 stars 2 forks source link

QML errors when switching between feed and web content #104

Closed cscarney closed 1 year ago

cscarney commented 1 year ago

When ArticleView::text is changed, the following QML errors are logged:

 qrc:/qml/ArticleView.qml:94: TypeError: Cannot read property 'status' of null
 qrc:/qml/ArticleView.qml:140: TypeError: Cannot read property 'text' of null

These errors don't (currently) cause any user-facing problems, but the console spam makes debugging real problems more difficult.

The issue occurs when text blocks are removed from the content model. We destroy the model objects immediately when they are removed, but the QML engine defers destroying the delegate instances, so they briefly exist with a null model.

cscarney commented 1 year ago

Previously "fixed" this problem in 73f152859ef76c64f84a845b06a472f607f432d8, but it's back. We use deleteLater() on the model objects, but that only defers until we return to the event loop; QML waits until the next frame.