summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine/qstatemachine.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-07 11:40:40 +0200
committerEskil Abrahamsen Blomfeldt <eblomfel@trolltech.com>2009-05-07 11:40:40 +0200
commit576dca0086b1566eafe9a24cf5946f46f4e857bf (patch)
treebc2c310f1afec94e52c733a6c02af03cafe310c2 /src/corelib/statemachine/qstatemachine.h
parent74cdd7c31e91e15d5941ece11a6bdf1c4e1b2309 (diff)
Fix infinite loop when source and target of transition are in different trees
The SCXML algorithm depends on the guarantee that there is always an LCA regardless of the state list. The case where the targets are in a different tree than the source (e.g. if you have not given the target state a parent) is a bug. The fix is to set an error when this happens in exitStates() and exit states as if the pending error states were the target states. In enterStates we will detect the error and skip the step of selecting states to enter, and instead just enter the pending error states. This breaks transitions to and from the root state, which is not supported by the SCXML algorithm.
Diffstat (limited to 'src/corelib/statemachine/qstatemachine.h')
-rw-r--r--src/corelib/statemachine/qstatemachine.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h
index 10bd443f1f..d0927a39e9 100644
--- a/src/corelib/statemachine/qstatemachine.h
+++ b/src/corelib/statemachine/qstatemachine.h
@@ -87,6 +87,7 @@ public:
NoError,
NoInitialStateError,
NoDefaultStateInHistoryState,
+ NoCommonAncestorForTransitionError
};
QStateMachine(QObject *parent = 0);