diff options
author | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-12-04 10:24:27 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-12-04 14:23:11 (GMT) |
commit | ac83e69ffbabff8a5e674d38f0bc90ff5f188f6e (patch) | |
tree | 5f232e09e0ba225789265c33ae142e953212e362 /src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | |
parent | e112bc5d2e1eb567aef3077a014a021244ed2ece (diff) | |
download | Qt-ac83e69ffbabff8a5e674d38f0bc90ff5f188f6e.zip Qt-ac83e69ffbabff8a5e674d38f0bc90ff5f188f6e.tar.gz Qt-ac83e69ffbabff8a5e674d38f0bc90ff5f188f6e.tar.bz2 |
Made sure that we didn't reference dangling parallel anchors.
We cannot delete the parallel anchors before we do the actual vertex
restoration, since the parallel anchors created by vertex simplification
will always be connected to some of the AnchorVertexPair found in
simplifiedVertices that we iterate over later.
Thus, we must delete the parallel anchors created by vertex
simplification after we have done the restoration of the vertices. (the
parallel anchor will be properly dealt with (i.e. taken out of the
graph as we do the restoration)), so not deleting it won't cause it to
be revisited later if that is a worry.
Reviewed-by: Eduardo M. Fleury
Diffstat (limited to 'src/gui/graphicsview/qgraphicsanchorlayout_p.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp index b33e228..03ed63d 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp @@ -1317,9 +1317,7 @@ void QGraphicsAnchorLayoutPrivate::restoreVertices(Orientation orientation) for (int i = parallelAnchors.count() - 1; i >= 0; --i) { ParallelAnchorData *parallel = static_cast<ParallelAnchorData *>(parallelAnchors.at(i)); restoreSimplifiedConstraints(parallel); - delete parallel; } - parallelAnchors.clear(); // Then, we will restore the vertices in the inverse order of creation, this way we ensure that // the vertex being restored was not wrapped by another simplification. @@ -1365,6 +1363,8 @@ void QGraphicsAnchorLayoutPrivate::restoreVertices(Orientation orientation) delete pair; } + qDeleteAll(parallelAnchors); + parallelAnchors.clear(); toRestore.clear(); } |