diff --git a/code/nel/tools/pipeline/service/database_status.cpp b/code/nel/tools/pipeline/service/database_status.cpp index 046504f12..198aa6445 100644 --- a/code/nel/tools/pipeline/service/database_status.cpp +++ b/code/nel/tools/pipeline/service/database_status.cpp @@ -414,7 +414,7 @@ void updatePathStatus(CDatabaseStatus* ds, CDatabaseStatusUpdater &updater, cons void updateDirectoryStatus(CDatabaseStatus* ds, CDatabaseStatusUpdater &updater, const std::string &dir, bool recurse) { - if (!g_IsMaster) + if (!g_IsExiting && !g_IsMaster) { nlerror("Not master, not allowed."); } diff --git a/code/nel/tools/pipeline/service/module_pipeline_master.cpp b/code/nel/tools/pipeline/service/module_pipeline_master.cpp index 4b1f77bf4..e57f7b01f 100644 --- a/code/nel/tools/pipeline/service/module_pipeline_master.cpp +++ b/code/nel/tools/pipeline/service/module_pipeline_master.cpp @@ -170,6 +170,9 @@ public: g_IsMaster = false; + nldebug("Wait for tasks on the master"); + while (m_TaskManager->getNumWaitingTasks() > 0) + nlSleep(10); delete m_TaskManager; m_TaskManager = NULL; @@ -523,6 +526,7 @@ public: nlwarning("Slave disconnected before callback could be delivered"); CInfoFlags::getInstance()->removeFlag(PIPELINE_INFO_MASTER_UPDATE_DATABASE_FOR_SLAVE); CInfoFlags::getInstance()->addFlag(PIPELINE_INFO_SLAVE_CB_GONE); + Master->m_SlavesMutex.unlock(); delete this; return; } @@ -589,8 +593,15 @@ public: if (ok) { - CUpdateDatabaseStatusByVectorTask *slaveTask = new CUpdateDatabaseStatusByVectorTask(this, sender, slave->Vector); // slave->Vector is wiped due to swap - m_TaskManager->addTask(slaveTask); + if (g_IsExiting) + { + nlwarning("Cannot add task while exiting"); + } + else + { + CUpdateDatabaseStatusByVectorTask *slaveTask = new CUpdateDatabaseStatusByVectorTask(this, sender, slave->Vector); // slave->Vector is wiped due to swap + m_TaskManager->addTask(slaveTask); + } } } diff --git a/code/nel/tools/pipeline/service/module_pipeline_slave.cpp b/code/nel/tools/pipeline/service/module_pipeline_slave.cpp index 4e59b39c3..16a1749b9 100644 --- a/code/nel/tools/pipeline/service/module_pipeline_slave.cpp +++ b/code/nel/tools/pipeline/service/module_pipeline_slave.cpp @@ -125,9 +125,15 @@ public: // TODO? // wait till build task has exited if still was running // wait for other things to exist in case there are... + nldebug("Wait for tasks on the slave"); + while (m_TaskManager->getNumWaitingTasks() > 0) + nlSleep(10); delete m_TaskManager; m_TaskManager = NULL; + if (m_AbortRequested) + finalizeAbort(); // hopefully this is fine + // temp sanity nlassert(m_ActiveProject == NULL); nlassert(m_ActiveProcess == NULL);