QDBusAbstractAdaptor: Assert that the parent is not null
QDBusAbstractAdaptor is expected to be used with a parent. Add an assertion that will fail if a user is using this class incorrectly. That's easier to debug than a null pointer dereference in QDBusAdaptorConnector::polish(). Fixes: QTBUG-18525 Change-Id: I1934475fe277e0cc08435d79f1d453d6576f0b1c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
5ef5f2f1b9
commit
7169ea71bd
|
|
@ -104,6 +104,9 @@ void QDBusAbstractAdaptorPrivate::saveIntrospectionXml(QDBusAbstractAdaptor *ada
|
|||
QDBusAbstractAdaptor::QDBusAbstractAdaptor(QObject* obj)
|
||||
: QObject(*new QDBusAbstractAdaptorPrivate, obj)
|
||||
{
|
||||
|
||||
Q_ASSERT_X(obj, Q_FUNC_INFO, "Expected non-null parent");
|
||||
|
||||
QDBusAdaptorConnector *connector = qDBusCreateAdaptorConnector(obj);
|
||||
|
||||
connector->waitingForPolish = true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue