[Ktutorial-commits] SF.net SVN: ktutorial:[122] trunk/ktutorial/ktutorial-editor/tests/unit/ view/T
Status: Alpha
Brought to you by:
danxuliu
From: <dan...@us...> - 2010-03-07 23:13:16
|
Revision: 122 http://ktutorial.svn.sourceforge.net/ktutorial/?rev=122&view=rev Author: danxuliu Date: 2010-03-07 23:13:10 +0000 (Sun, 07 Mar 2010) Log Message: ----------- Fix memory leak in test. Modified Paths: -------------- trunk/ktutorial/ktutorial-editor/tests/unit/view/TutorialTreeItemTest.cpp Modified: trunk/ktutorial/ktutorial-editor/tests/unit/view/TutorialTreeItemTest.cpp =================================================================== --- trunk/ktutorial/ktutorial-editor/tests/unit/view/TutorialTreeItemTest.cpp 2010-03-07 23:11:37 UTC (rev 121) +++ trunk/ktutorial/ktutorial-editor/tests/unit/view/TutorialTreeItemTest.cpp 2010-03-07 23:13:10 UTC (rev 122) @@ -357,10 +357,12 @@ Tutorial tutorial; TutorialTreeItem item(&tutorial); - Step* step = new Step(); - step->setId("Step id"); - tutorial.addStep(step); - tutorial.removeStep(step); + //It will be removed and not deleted by the Tutorial, so it is created in + //stack + Step step; + step.setId("Step id"); + tutorial.addStep(&step); + tutorial.removeStep(&step); QCOMPARE(item.childCount(), 0); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |