diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2013-12-19 14:42:13 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-08 15:03:49 +0100 |
commit | 5354cb73e25afbdf55b78c29ca32c1b305aa7efe (patch) | |
tree | 71270d20be228b1aedc418bc47d3d538a2791d06 /examples | |
parent | d2441caf6eb37a5fc0ae250064e8df344070a522 (diff) | |
download | qtwebchannel-5354cb73e25afbdf55b78c29ca32c1b305aa7efe.tar.gz |
Fix assertion at shutdown or on QObject destruction.
When handling the destroyed signal of a QObject, the QMetaObject of the
sender() will point to the global static QObject meta object. Thus, we
also cache its signal argument types. This way, we are able to properly
handle the destroyed signal with minimum effort.
Change-Id: Iba1a3fc94d55adad178302cc847fd4285815e689
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/standalone/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/standalone/main.cpp b/examples/standalone/main.cpp index 99e325b..6970633 100644 --- a/examples/standalone/main.cpp +++ b/examples/standalone/main.cpp @@ -116,10 +116,10 @@ int main(int argc, char** argv) QObject::connect(&channel, SIGNAL(rawMessageReceived(QString)), &publisher, SLOT(handleRawMessage(QString))); - Dialog* dialog = new Dialog(&channel); + Dialog dialog(&channel); QVariantMap objects; - objects[QStringLiteral("dialog")] = QVariant::fromValue(dialog); + objects[QStringLiteral("dialog")] = QVariant::fromValue(&dialog); publisher.registerObjects(objects); return app.exec(); |