Details
-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
None
-
5.1.0 Beta 1
-
None
Description
This may very well be as-designed, but it seems like a bug, and results in ugly code to avoid lots of binding errors on application exit.
Attached is an example. It should print something like:
MyObject(0x1188be8)
when the application starts, and when you close the window that it opens, it will then print.
null
The property p is assigned a QObject created in CPP, owned by the javascript engine. On engine destruction, that CPP object gets garbage collected, but any bindings involving p get executed with p == null. This leads us to have to check for null in every binding involving these kinds of objects, which is ugly and unexpected:
property var o: <some C++ object, owned by JS so o should always be valid> property int otherProperty: o ? o.value : 0
I'm also trying to track down a crash which looks related, but which I've been unable to generate a small example for.