summaryrefslogtreecommitdiff
path: root/src/webchannel/signalhandler_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/webchannel/signalhandler_p.h')
-rw-r--r--src/webchannel/signalhandler_p.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/webchannel/signalhandler_p.h b/src/webchannel/signalhandler_p.h
index f5a378a..3431f1b 100644
--- a/src/webchannel/signalhandler_p.h
+++ b/src/webchannel/signalhandler_p.h
@@ -264,12 +264,12 @@ void SignalHandler<Receiver>::clear()
template<class Receiver>
void SignalHandler<Receiver>::remove(const QObject *object)
{
- Q_ASSERT(m_connectionsCounter.contains(object));
- const SignalConnectionHash &connections = m_connectionsCounter.value(object);
- foreach (const ConnectionPair &connection, connections) {
+ auto it = m_connectionsCounter.find(object);
+ Q_ASSERT(it != m_connectionsCounter.cend());
+ const SignalConnectionHash connections = std::move(it.value());
+ m_connectionsCounter.erase(it);
+ for (const ConnectionPair &connection : connections)
QObject::disconnect(connection.first);
- }
- m_connectionsCounter.remove(object);
}
QT_END_NAMESPACE