Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
4.7.0
-
None
Description
The Item's onDestroyed signal needs to be called while the element still
exists to allow cleanup based on the item's reference. This does not appear
to be the case, at least when the item is destroyed as a result of the QML app
being reloaded.
I.e. running this code
Rectangle { id: rect color:"red" Component.onCompleted: print("Created " + rect.toString()); onDestroyed: print("Destroyed " + rect.toString()); // results in "Result of expression 'rect' [undefined] is not an object." }
then pressing Ctrl+R in the QML viewer to reload the application, rect is already
"undefined" when onDestroyed is called. Is this also the case when e.g. a ListView
deallocates a delegate?