All, I'm a bit of a Qt novice but I have been working on a custom gauge with a dynamic number of ticks, all drawn in updatePaintNode. The Node hierarchy is like this: QSGNode (root/old node) --> QSGGeometryNode (Background) --> QSGGeometryNode (Border/Edge) --> QSGNode (Tick Container) -----> QSGGeometryNode (n # of ticks)
The issue comes when it needs to be updated, both the background and border geometries are kept as pointers and can be easily changed without having to recreate the nodes, but the ticks have to be removed and created again. I used the removeAllChildren on the Tick Container Node, then created all new children afterwards. In reality the end result works all fine and dandy, except for a memory leak I traced to be located when creating the new ones but it could be leftover from deletion of the old. >From my understanding, adding the flags OwnsGeometry and OwnsMaterial on the generated GeometryNodes should handle the deletion of the material and geometry when the node is removed using removeAllChildren and that exiting the updatePaintNode should have handled all pointers to QSGGeometryNodes, QSGGeomtries and QSGFlatColorMaterials. My suspicion is that these Geometries and Materials are not getting freed, causing the leak. Is there something I am missing when removing and creating new nodes that should be done or is there a better way going about this? Thanks, Nathan
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest