From 5354cb73e25afbdf55b78c29ca32c1b305aa7efe Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Thu, 19 Dec 2013 14:42:13 +0100 Subject: 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 --- examples/standalone/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') 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(); -- cgit v1.2.1