From e4dd38fe63eb3035b2df0db859c65d31db9c1ea8 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Thu, 15 Sep 2016 14:22:13 +0900 Subject: Connection: Don't return SyncJob* from sync() Given that Connection handles all the output from SyncJob already, there's no use in having the pointer. In fact, it's not used in Quaternion, and Tensor, to the contrary, has a problem _because_ this pointer is grabbed by the QML engine that mistakenly tries to handle its lifecycle. --- connection.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'connection.cpp') diff --git a/connection.cpp b/connection.cpp index aebe7631..9f56ec96 100644 --- a/connection.cpp +++ b/connection.cpp @@ -163,10 +163,10 @@ void Connection::logout() job->start(); } -SyncJob* Connection::sync(int timeout) +void Connection::sync(int timeout) { if (d->syncJob) - return d->syncJob; + return; const QString filter = "{\"room\": { \"timeline\": { \"limit\": 100 } } }"; auto job = d->startSyncJob(filter, timeout); @@ -187,7 +187,6 @@ SyncJob* Connection::sync(int timeout) else emit connectionError(job->errorString()); }); - return job; } SyncJob* Connection::Private::startSyncJob(const QString& filter, int timeout) -- cgit v1.2.3