src/corelib/statemachine/qstatemachine.cpp
changeset 7 f7bc934e204c
parent 3 41300fa6a67c
--- a/src/corelib/statemachine/qstatemachine.cpp	Tue Feb 02 00:43:10 2010 +0200
+++ b/src/corelib/statemachine/qstatemachine.cpp	Wed Mar 31 11:06:36 2010 +0300
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
@@ -1175,6 +1175,16 @@
     _startState = 0;
 }
 
+void QStateMachinePrivate::clearHistory()
+{
+    Q_Q(QStateMachine);
+    QList<QHistoryState*> historyStates = qFindChildren<QHistoryState*>(q);
+    for (int i = 0; i < historyStates.size(); ++i) {
+        QHistoryState *h = historyStates.at(i);
+        QHistoryStatePrivate::get(h)->configuration.clear();
+    }
+}
+
 void QStateMachinePrivate::_q_start()
 {
     Q_Q(QStateMachine);
@@ -1186,6 +1196,7 @@
     internalEventQueue.clear();
     qDeleteAll(externalEventQueue);
     externalEventQueue.clear();
+    clearHistory();
 
 #ifdef QSTATEMACHINE_DEBUG
     qDebug() << q << ": starting";