[qet] [2402] previous comit was wrong, this is good bugfix

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 2402
Author:   blacksun
Date:     2013-07-29 00:48:36 +0200 (Mon, 29 Jul 2013)
Log Message:
-----------
previous comit was wrong, this is good bugfix

Modified Paths:
--------------
    trunk/sources/editor/elementscene.cpp
    trunk/sources/qgimanager.cpp

Modified: trunk/sources/editor/elementscene.cpp
===================================================================
--- trunk/sources/editor/elementscene.cpp	2013-07-28 21:55:02 UTC (rev 2401)
+++ trunk/sources/editor/elementscene.cpp	2013-07-28 22:48:36 UTC (rev 2402)
@@ -1046,11 +1046,13 @@
 void ElementScene::reset() {
 	// supprime les objets d'annulation
 	undoStack().clear();
+
 	// enleve les elements de la scene
-	foreach (QGraphicsItem *qgi, items()) {
+	foreach (QGraphicsItem *qgi, items()) {	
+		removeItem(qgi);
 		qgiManager().release(qgi);
-		removeItem(qgi);
 	}
+	decorator_ = 0;
 }
 
 /**

Modified: trunk/sources/qgimanager.cpp
===================================================================
--- trunk/sources/qgimanager.cpp	2013-07-28 21:55:02 UTC (rev 2401)
+++ trunk/sources/qgimanager.cpp	2013-07-28 22:48:36 UTC (rev 2402)
@@ -60,8 +60,8 @@
 	if (!qgi_manager.contains(qgi)) return;
 	-- qgi_manager[qgi];
 	if (qgi_manager[qgi] <= 0 && !(scene -> items().contains(qgi))) {
+		qgi_manager.remove(qgi);
 		delete qgi;
-		qgi_manager.remove(qgi);
 	}
 }
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/