Q_NEW_X() fails when QEVT_DYN_CTOR is defined
Real-Time Event Frameworks based on active objects & state machines
Brought to you by:
quantum-leaps
When QEVT_DYN_CTOR is defined, the macro Q_NEW_X() becomes variadic and performs initialization of the event parameters (RAII for dynamic events). However, when the allocation fails, the initialization via the ctor() member function fails, because it is called on a nullptr (this == nullptr). This crashes the program.
--MMS
Anonymous
This issue has been fixed by re-designing the feature of event initialization at the point of dynamic allocation. Please see the documentation of
QEvt::init()at https://www.state-machine.com/qpcpp/class_q_p_1_1_q_evt.html--MMS