Don't parent connections to controller/Login.

This prevents a crash upon destruction for newer libquotient versions
This commit is contained in:
Tobias Fella
2021-10-03 14:13:04 +02:00
parent cd745d1df7
commit 452380e274
2 changed files with 3 additions and 3 deletions

View File

@@ -144,7 +144,7 @@ void Controller::loginWithAccessToken(const QString &serverAddr, const QString &
QUrl serverUrl(serverAddr); QUrl serverUrl(serverAddr);
auto conn = new Connection(this); auto conn = new Connection();
if (serverUrl.isValid()) { if (serverUrl.isValid()) {
conn->setHomeserver(serverUrl); conn->setHomeserver(serverUrl);
} }
@@ -260,7 +260,7 @@ void Controller::invokeLogin()
if (!account.homeserver().isEmpty()) { if (!account.homeserver().isEmpty()) {
auto accessToken = loadAccessTokenFromKeyChain(account); auto accessToken = loadAccessTokenFromKeyChain(account);
auto connection = new Connection(account.homeserver(), this); auto connection = new Connection(account.homeserver());
connect(connection, &Connection::connected, this, [=] { connect(connection, &Connection::connected, this, [=] {
connection->loadState(); connection->loadState();
addConnection(connection); addConnection(connection);

View File

@@ -36,7 +36,7 @@ void Login::init()
m_testing = true; m_testing = true;
Q_EMIT testingChanged(); Q_EMIT testingChanged();
if (!m_connection) { if (!m_connection) {
m_connection = new Connection(this); m_connection = new Connection();
} }
m_connection->resolveServer(m_matrixId); m_connection->resolveServer(m_matrixId);
connect(m_connection, &Connection::loginFlowsChanged, this, [=]() { connect(m_connection, &Connection::loginFlowsChanged, this, [=]() {