[Pkg-owncloud-commits] [owncloud-client] 83/164: Discovery: Free some memory before propagate (#2902)

Sandro Knauß hefee-guest at moszumanska.debian.org
Sun Mar 22 11:56:56 UTC 2015


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

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

commit fe574dbbf98b1f70911cb37812de13d43ae838fa
Author: Markus Goetz <markus at woboq.com>
Date:   Mon Mar 2 15:08:21 2015 +0100

    Discovery: Free some memory before propagate (#2902)
---
 csync/src/csync.c          |  9 ---------
 csync/src/csync.h          |  2 +-
 src/libsync/syncengine.cpp | 10 ++++++++++
 src/libsync/syncengine.h   |  1 +
 4 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/csync/src/csync.c b/csync/src/csync.c
index 1b99428..2390eaa 100644
--- a/csync/src/csync.c
+++ b/csync/src/csync.c
@@ -573,15 +573,6 @@ int csync_commit(CSYNC *ctx) {
   }
   ctx->statedb.db = NULL;
 
-#ifdef USE_NEON
-  rc = owncloud_commit(ctx);
-  if (rc < 0) {
-    CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "commit failed: %s",
-              ctx->error_string ? ctx->error_string : "");
-    goto out;
-  }
-#endif
-
   _csync_clean_ctx(ctx);
 
   ctx->remote.read_from_db = 0;
diff --git a/csync/src/csync.h b/csync/src/csync.h
index a3c490e..85a4bfb 100644
--- a/csync/src/csync.h
+++ b/csync/src/csync.h
@@ -337,7 +337,7 @@ int csync_update(CSYNC *ctx);
 int csync_reconcile(CSYNC *ctx);
 
 /**
- * @brief Commit the sync results to journal
+ * @brief Re-initializes the csync context
  *
  * @param ctx  The context to commit.
  *
diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp
index b7b769c..ec9de3b 100644
--- a/src/libsync/syncengine.cpp
+++ b/src/libsync/syncengine.cpp
@@ -708,8 +708,12 @@ void SyncEngine::slotDiscoveryJobFinished(int discoveryResult)
         qDebug() << "Permissions of the root folder: " << _remotePerms[QLatin1String("")];
     }
 
+    // Re-init the csync context to free memory
+    csync_commit(_csync_ctx);
+
     // The map was used for merging trees, convert it to a list:
     _syncedItems = _syncItemMap.values().toVector();
+    _syncItemMap.clear(); // free memory
 
     // Adjust the paths for the renames.
     for (SyncFileItemVector::iterator it = _syncedItems.begin();
@@ -863,6 +867,12 @@ void SyncEngine::finalize()
 {
     _thread.quit();
     _thread.wait();
+
+#ifdef USE_NEON
+    // De-init the neon HTTP(S) connections
+    csync_owncloud_commit(ctx);
+#endif
+
     csync_commit(_csync_ctx);
 
     qDebug() << "CSync run took " << _stopWatch.addLapTime(QLatin1String("Sync Finished"));
diff --git a/src/libsync/syncengine.h b/src/libsync/syncengine.h
index e616c6d..63990ab 100644
--- a/src/libsync/syncengine.h
+++ b/src/libsync/syncengine.h
@@ -141,6 +141,7 @@ private:
 
     static bool _syncRunning; //true when one sync is running somewhere (for debugging)
 
+    // Must only be acessed during update and reconcile
     QMap<QString, SyncFileItem> _syncItemMap;
 
     // should be called _syncItems (present tense). It's the items from the _syncItemMap but

-- 
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