diff --git a/source/shared_lib/sources/platform/common/simple_threads.cpp b/source/shared_lib/sources/platform/common/simple_threads.cpp index 6445e255b..5a425baa9 100644 --- a/source/shared_lib/sources/platform/common/simple_threads.cpp +++ b/source/shared_lib/sources/platform/common/simple_threads.cpp @@ -278,14 +278,16 @@ void LogFileThread::saveToDisk(bool forceSaveAll,bool logListAlreadyLocked) { // logCount = min(logCount,(std::size_t)2000000); //} - for(unsigned int i = 0; i < logCount; ++i) { - LogFileEntry &entry = tempLogList[i]; - SystemFlags::logDebugEntry(entry.type, entry.entry, entry.entryDateTime); - } + if(logCount > 0) { + for(unsigned int i = 0; i < logCount; ++i) { + LogFileEntry &entry = tempLogList[i]; + SystemFlags::logDebugEntry(entry.type, entry.entry, entry.entryDateTime); + } - safeMutex.Lock(); - logList.erase(logList.begin(),logList.begin() + logCount); - safeMutex.ReleaseLock(); + safeMutex.Lock(); + logList.erase(logList.begin(),logList.begin() + logCount); + safeMutex.ReleaseLock(); + } } else { safeMutex.ReleaseLock(); diff --git a/source/shared_lib/sources/platform/posix/miniftpclient.cpp b/source/shared_lib/sources/platform/posix/miniftpclient.cpp index 4ee7c9325..f1f22d622 100644 --- a/source/shared_lib/sources/platform/posix/miniftpclient.cpp +++ b/source/shared_lib/sources/platform/posix/miniftpclient.cpp @@ -132,7 +132,7 @@ static long file_is_comming(struct curl_fileinfo *finfo,void *data,int remains) static long file_is_downloaded(void *data) { struct FtpFile *out=(struct FtpFile *)data; if(out->stream) { - printf("DOWNLOAD COMPLETE!\n"); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("DOWNLOAD COMPLETE!\n"); fclose(out->stream); out->stream = NULL; @@ -141,10 +141,7 @@ static long file_is_downloaded(void *data) { } int file_progress(struct FtpFile *out,double download_total, double download_now, double upload_total,double upload_now) { - // printf("%d / %d (%g %%)\n", d, t, d*100.0/t); - //gdk_threads_enter(); - //gtk_progress_set_value(GTK_PROGRESS(bar), d*100.0/t); - //gdk_threads_leave(); + if(SystemFlags::VERBOSE_MODE_ENABLED) printf(" download progress [%f][%f][%f][%f] ",download_total,download_now,upload_total,upload_now); if(out != NULL && out->ftpServer != NULL &&