ViewPiece.qml:105: TypeError: Cannot read property 'sessionName' of null
-
Hello list,
I have an app using qml , and running under debian/buster. Please see:
https://github.com/SietseAchterop/RtcNoordAppOn exiting the program that works fine in itself otherwise I get about 10 of the
above messages, of different properties. Always the "of null".
The properties are actually used in the correctly working app.
The problem also happens when I start the program and then immediately close it again.
There probably is something wrong in bringing down the application, but I have no
idea how to tackle this.I am not aware that I am doing something unusual.
Hopefully someone can point me in a direction.Thanks in advance, Sietse
-
Hi,
I'm having the same issue since Qt 5.14. When I quit my app all the properties I exposed to QML via setContextProperty are set to null or undefined and in some way QML tries to access them on exit. It was fine in 5.13.
Thomas
-
Now you mention it, I think that's the case here also.
So it could well be a regression. -
Hi,
I've created an issue on Qt bug report platform : https://bugreports.qt.io/browse/QTBUG-81247
-
If you didn't check the QTBUG, the solution is to construct the object you want to expose to QML before the engine itself so they are destroyed after the engine.
-
The bug was closed, but I still see the problem.
context.setContextProperty("bridge", bridge) ... engine.load(QtCore.QUrl.fromLocalFile(str(qmlFile)))
I need that order because the bridge provides the data needed in the qml file. But on exit, it seems like the bridge gets closed before the qml file. Any suggestions?
-
I believe I figured out this issue. I left a comment on the linked bug.