void OutputConnection::clear() { for(auto &c: connected_to) { auto c_s= c.lock(); if(c_s) c_s->forgetConnection(this); } //and then kill the whole set. connected_to.clear(); }
void ExternalPluginServer::storeNewConnection() { qDebug() << "Plugin is requesting connection"; QLocalSocket *connection = m_server->nextPendingConnection(); if (connection == NULL) { qCritical() << "Mystery plugin is requesting connection, but escapes from connect"; Q_ASSERT(false); } bool res; res = connect(connection, SIGNAL(readyRead()), this, SLOT(readPluginData())); Q_ASSERT(res == true); res = connect(connection, SIGNAL(disconnected()), this, SLOT(forgetConnection())); Q_ASSERT(res == true); m_pluginConnections.insertMulti("-1", connection); }