[SOLVED] Thread safety with deletion of dynamically created components
-
I have dynamically created QML components to read user input in various ways. I iterate through them in the main QML rectangle to query some changed properties. This is done with a javascript loop checking the children of the main container. I now want to allow the user to close (and destroy) these components by using a destroy() call when clicking on a close button inside them.
How can I ensure that this is safe and I'm not trying to access a component that is being destroyed while iterating through my loop in the main QML rectangle?
-
The loop in your QML is actually still in the main thread. All GUI elements have to live in the main thread (QML or otherwise) so there shouldn't be any threading issue at all.
-
Thanks for your response. I can sleep at night :)
-
No problem! Sleep well!