Do not access QObject API before its private data is initialized.
authorMilian Wolff <mail@milianw.de>
Thu, 6 Feb 2014 16:30:55 +0000 (17:30 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 6 Feb 2014 19:17:10 +0000 (20:17 +0100)
commit6e7f54a014c43dcd6e32e8288415808623e306f4
tree660a396149c93da25299ceb2e52d10f420e22d64
parent95655e87913556e69bdda4a9b3140da4602031e4
Do not access QObject API before its private data is initialized.

Inside the ctor of the private data, the QObject has not yet
been associated with the data. Thus, accessing it indirectly i.e.
to setup private signal/slot connections, will trigger crashes.

Now we delay accessing this API and call an init() function manually
in the parent QObject-inheriting class.

Change-Id: I2c3ce7335c54d42af6bce87de867ee0ef197efc6
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
src/websockets/qwebsocket.cpp
src/websockets/qwebsocket_p.cpp
src/websockets/qwebsocketserver.cpp
src/websockets/qwebsocketserver_p.cpp
src/websockets/qwebsocketserver_p.h