QHostInfo::lookupHostImpl: add another precondition check
If `member` is set it means that the caller wants us to connect to a slot using string-based connections. That means `receiver` must be non-null as well. Check for it. Change-Id: I6b3542855147e95fecbf4c645b556c2047a1ed69 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
afe158b936
commit
c63de2cda3
@ -750,6 +750,7 @@ int QHostInfo::lookupHostImpl(const QString &name,
|
|||||||
#endif
|
#endif
|
||||||
Q_ASSERT(!member != !slotObj); // one of these must be set, but not both
|
Q_ASSERT(!member != !slotObj); // one of these must be set, but not both
|
||||||
Q_ASSERT(receiver || slotObj);
|
Q_ASSERT(receiver || slotObj);
|
||||||
|
Q_ASSERT(!member || receiver); // if member is set, also is receiver
|
||||||
|
|
||||||
if (!QAbstractEventDispatcher::instance(QThread::currentThread())) {
|
if (!QAbstractEventDispatcher::instance(QThread::currentThread())) {
|
||||||
qWarning("QHostInfo::lookupHost() called with no event dispatcher");
|
qWarning("QHostInfo::lookupHost() called with no event dispatcher");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user