void QQmlNotifierEndpoint::disconnect()
{
+ // Remove from notifier chain before calling disconnectNotify(), so that that
+ // QObject::receivers() returns the correct value in there
+ if (next) next->prev = prev;
+ if (prev) *prev = next;
+
if (sourceSignal != -1) {
QObject * const obj = senderAsObject();
QObjectPrivate * const priv = QObjectPrivate::get(obj);
priv->disconnectNotify(QMetaObjectPrivate::signal(obj->metaObject(), sourceSignal));
}
- if (next) next->prev = prev;
- if (prev) *prev = next;
+
if (isNotifying()) *((intptr_t *)(senderPtr & ~0x1)) = 0;
next = 0;
prev = 0;
if (signal.name() == "scriptBindingPropChanged") scriptBindingPropConnections++;
if (signal.name() == "boundSignal") boundSignalConnections++;
if (signal.name() == "unusedSignal") unusedSignalConnections++;
+ verifyReceiverCount();
//qDebug() << Q_FUNC_INFO << this << signal.name();
}
if (signal.name() == "scriptBindingPropChanged") scriptBindingPropConnections--;
if (signal.name() == "boundSignal") boundSignalConnections--;
if (signal.name() == "unusedSignal") unusedSignalConnections--;
+ verifyReceiverCount();
//qDebug() << Q_FUNC_INFO << this << signal.methodSignature();
}