summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-08-13 12:23:46 +0200
committerToby Tomkins <toby.tomkins@nokia.com>2010-08-18 22:21:14 +1000
commit81bb682e280dc282ba965051e232f81f64c1f3fe (patch)
tree801d912bd01440a8d2a614c0cfe9220976d583d0 /doc
parent279c5eb3bd7c8bb836f2a3f8f5a0b1dc046dc24a (diff)
diagramscene example: fix leak and crashes.
In MainWindow::deleteItem, if there is arrow selected, we need to clean up the items from this arrow. We need to delete them first so there is no arrow in the list anymore when we calls removeArrows (which before, deleted arrow that were possibly in the list, resulting in crashes) Also avoid leak by giving parents to objects that needs it, and destroying items. Reviewed-by: Geir Vattekar Task-number: QTBUG-12753 (cherry picked from commit 5dedcd3c4cac993949295d109804a8f7cc3a5b0a)
Diffstat (limited to 'doc')
-rw-r--r--doc/src/examples/diagramscene.qdoc3
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/src/examples/diagramscene.qdoc b/doc/src/examples/diagramscene.qdoc
index f4d6b0d41f..7c643c2d38 100644
--- a/doc/src/examples/diagramscene.qdoc
+++ b/doc/src/examples/diagramscene.qdoc
@@ -265,7 +265,8 @@
\snippet examples/graphicsview/diagramscene/mainwindow.cpp 3
- This slot deletes the selected item, if any, from the scene. If
+ This slot deletes the selected item, if any, from the scene. It
+ deletes the arrows first in order to avoid to delete them twice. If
the item to be deleted is a \c DiagramItem, we also need to delete
arrows connected to it; we don't want arrows in the scene that
aren't connected to items in both ends.