зеркало из https://github.com/nextcloud/desktop.git
Discovery: Free some memory before propagate (#2902)
This commit is contained in:
Родитель
7595c7e697
Коммит
fe574dbbf9
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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"));
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче