logic: release fixes

* disable windows error dialogs on application crash for indexer target
* show indexing dialog at the start of indexing task instead of waiting for processes to start
* fix escaping path to binary for indexer process
* join garbagecollector thread when stopping
* fix compile errors related to FilePath in deploy mode on windows
This commit is contained in:
malte_langkabel
2017-05-05 16:37:48 +02:00
parent 562e623930
commit e8a24d3d98
5 changed files with 24 additions and 9 deletions
+3 -1
View File
@@ -43,6 +43,8 @@ TaskBuildIndex::TaskBuildIndex(
void TaskBuildIndex::doEnter(std::shared_ptr<Blackboard> blackboard)
{
updateIndexingDialog(blackboard, FilePath());
{
std::lock_guard<std::mutex> lock(blackboard->getMutex());
blackboard->set("indexer_count", (int)m_processCount);
@@ -177,7 +179,7 @@ void TaskBuildIndex::runIndexerProcess(int processId, const std::string& logFile
return;
}
std::string command = indexerProcessPath.str();
std::string command = "\"" + indexerProcessPath.str() + "\"";
command += " " + std::to_string(processId);
command += " " + Application::getUUID();
command += " \"" + AppPath::getAppPath() + "\"";
@@ -45,7 +45,7 @@ void SharedMemoryGarbageCollector::run(const std::string& uuid)
m_uuid = uuid;
std::thread(
m_thread = std::make_shared<std::thread>(
[this]()
{
m_loopIsRunning = true;
@@ -57,7 +57,7 @@ void SharedMemoryGarbageCollector::run(const std::string& uuid)
std::this_thread::sleep_for(std::chrono::seconds(s_updateIntervalSeconds));
}
}
).detach();
);
}
void SharedMemoryGarbageCollector::stop()
@@ -66,6 +66,9 @@ void SharedMemoryGarbageCollector::stop()
m_loopIsRunning = false;
m_thread->join();
m_thread.reset();
{
std::lock_guard<std::mutex> lock(m_sharedMemoryNamesMutex);
m_removedSharedMemoryNames.insert(m_sharedMemoryNames.begin(), m_sharedMemoryNames.end());
@@ -1,6 +1,7 @@
#ifndef SHARED_MEMORY_GARBAGE_COLLECTOR_H
#define SHARED_MEMORY_GARBAGE_COLLECTOR_H
#include <memory>
#include <mutex>
#include <string>
#include <set>
@@ -38,6 +39,7 @@ private:
SharedMemory m_memory;
volatile bool m_loopIsRunning;
std::shared_ptr<std::thread> m_thread;
std::string m_uuid;