[Pkg-owncloud-commits] [owncloud-client] 59/84: CleanupPollsJob: Fix possible leak

Sandro Knauß hefee at moszumanska.debian.org
Fri Oct 21 22:51:55 UTC 2016


This is an automated email from the git hooks/post-receive script.

hefee pushed a commit to branch master
in repository owncloud-client.

commit 65c49e1de6b5810136753cf359eefe7ccd49dc0e
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Thu Jul 14 09:21:28 2016 +0200

    CleanupPollsJob: Fix possible leak
    
    Missing deleteLater when the CleanupPollsJob aborts.
    This is only a problem if the SyncEngine is kept alive a long time. Which is
    usually not the case in the configuration where poll jobs are used.
    
    (cherry picked from commit 34650248985914523f0684c597f0c366b703f8d7)
---
 src/libsync/owncloudpropagator.cpp | 2 ++
 src/libsync/owncloudpropagator.h   | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/src/libsync/owncloudpropagator.cpp b/src/libsync/owncloudpropagator.cpp
index dce4403..72046fc 100644
--- a/src/libsync/owncloudpropagator.cpp
+++ b/src/libsync/owncloudpropagator.cpp
@@ -762,6 +762,7 @@ void CleanupPollsJob::slotPollFinished()
     Q_ASSERT(job);
     if (job->_item->_status == SyncFileItem::FatalError) {
         emit aborted(job->_item->_errorString);
+        deleteLater();
         return;
     } else if (job->_item->_status != SyncFileItem::Success) {
         qDebug() << "There was an error with file " << job->_item->_file << job->_item->_errorString;
@@ -771,6 +772,7 @@ void CleanupPollsJob::slotPollFinished()
             job->_item->_status = SyncFileItem::FatalError;
             job->_item->_errorString = tr("Error writing metadata to the database");
             emit aborted(job->_item->_errorString);
+            deleteLater();
             return;
         }
     }
diff --git a/src/libsync/owncloudpropagator.h b/src/libsync/owncloudpropagator.h
index 7c0a03a..8e2ce89 100644
--- a/src/libsync/owncloudpropagator.h
+++ b/src/libsync/owncloudpropagator.h
@@ -410,6 +410,10 @@ public:
 
     ~CleanupPollsJob();
 
+    /**
+     * Start the job.  After the job is completed, it will emit either finished or aborted, and it
+     * will destroy itself.
+     */
     void start();
 signals:
     void finished();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list