Commit 92f29f85 authored by Paul Lemire's avatar Paul Lemire
Browse files

FrameGraphNode: mark dirty on cleanup



Otherwise the FG cache is not rebuilt and we might have dangling
pointers around.

Change-Id: Id97de41092617acbf067fcac4cf7805c2eb715da
Reviewed-by: Mike Krus's avatarMike Krus <mike.krus@kdab.com>
parent aee3dbc8
......@@ -123,6 +123,7 @@ QVector<FrameGraphNode *> FrameGraphNode::children() const
void FrameGraphNode::cleanup()
{
setParentId({});
markDirty(AbstractRenderer::FrameGraphDirty);
}
void FrameGraphNode::syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime)
......
......@@ -266,6 +266,24 @@ private Q_SLOTS:
}
}
void checCleanupMarksDirty()
{
// GIVEN
TestRenderer renderer;
Qt3DRender::Render::FrameGraphNode *backendFGNode = new MyFrameGraphNode();
backendFGNode->setRenderer(&renderer);
// THEN
QVERIFY(renderer.dirtyBits() == 0);
// WHEN
backendFGNode->cleanup();
// THEN
QVERIFY(renderer.dirtyBits() & Qt3DRender::Render::AbstractRenderer::FrameGraphDirty);
}
};
QTEST_MAIN(tst_FrameGraphNode)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment