qt5base-lts/src/corelib/statemachine
Marc Mutz 3b9629e8bd QStateMachine: replace a QHash key involving a QPointer
Using QPointers (or any type that makes a QPointer part of its identity) as a key
in any associative container is wrong. They get externally set to nullptr,
violating the associative container's class invariants, which could lead to
data corruption, even though bucket-based hash implementations are less susceptible
than binary trees.

To fix, write a new class that acts much like the old QPair<QPointer<>,QByteArray>,
but uses the QPointer only as a guard, not as part of its identity. To preseve
identity, also saves the naked pointer originally passed and uses that for op==
and qHash().

Change-Id: I4fa5a6bf86bad8fe7f5abe53d7c7f3ad3754d8d6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-01-09 12:06:23 +01:00
..
qabstractstate_p.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qabstractstate.cpp Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qabstractstate.h Add Q_DECL_OVERRIDE in the src subdirectory 2014-12-03 09:57:11 +01:00
qabstracttransition_p.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qabstracttransition.cpp Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qabstracttransition.h Add Q_DECL_OVERRIDE in the src subdirectory 2014-12-03 09:57:11 +01:00
qeventtransition_p.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qeventtransition.cpp Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qeventtransition.h Add Q_DECL_OVERRIDE in the src subdirectory 2014-12-03 09:57:11 +01:00
qfinalstate.cpp Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qfinalstate.h Add Q_DECL_OVERRIDE in the src subdirectory 2014-12-03 09:57:11 +01:00
qhistorystate_p.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qhistorystate.cpp Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qhistorystate.h Add Q_DECL_OVERRIDE in the src subdirectory 2014-12-03 09:57:11 +01:00
qsignaleventgenerator_p.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qsignaltransition_p.h Add Q_DECL_OVERRIDE in the src subdirectory 2014-12-03 09:57:11 +01:00
qsignaltransition.cpp Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qsignaltransition.h Add Q_DECL_OVERRIDE in the src subdirectory 2014-12-03 09:57:11 +01:00
qstate_p.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qstate.cpp QState: Added template PointerToMemberFunction 2014-12-20 06:36:26 +01:00
qstate.h QState: Added template PointerToMemberFunction 2014-12-20 06:36:26 +01:00
qstatemachine_p.h QStateMachine: replace a QHash key involving a QPointer 2015-01-09 12:06:23 +01:00
qstatemachine.cpp QStateMachine: replace a QHash key involving a QPointer 2015-01-09 12:06:23 +01:00
qstatemachine.h Add Q_DECL_OVERRIDE in the src subdirectory 2014-12-03 09:57:11 +01:00
statemachine.pri Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00