mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-11 00:25:20 +02:00
make sure backup handlers end up on the correct thread
This commit is contained in:
parent
f624e1b464
commit
f5cad5683d
4 changed files with 11 additions and 7 deletions
|
@ -155,9 +155,6 @@ bool DomainContentBackupManager::process() {
|
|||
}
|
||||
|
||||
void DomainContentBackupManager::aboutToFinish() {
|
||||
qCDebug(domain_server) << "Persist thread about to finish...";
|
||||
backup();
|
||||
qCDebug(domain_server) << "Persist thread done with about to finish...";
|
||||
_stopThread = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -298,9 +298,13 @@ DomainServer::DomainServer(int argc, char* argv[]) :
|
|||
maybeHandleReplacementEntityFile();
|
||||
|
||||
_contentManager.reset(new DomainContentBackupManager(getContentBackupDir(), _settingsManager.settingsResponseObjectForType("6")["entity_server_settings"].toObject()));
|
||||
_contentManager->addBackupHandler(BackupHandlerPointer(new EntitiesBackupHandler(getEntitiesFilePath(), getEntitiesReplacementFilePath())));
|
||||
_contentManager->addBackupHandler(BackupHandlerPointer(new AssetsBackupHandler(getContentBackupDir())));
|
||||
_contentManager->addBackupHandler(BackupHandlerPointer(new ContentSettingsBackupHandler(_settingsManager)));
|
||||
|
||||
connect(_contentManager.get(), &DomainContentBackupManager::started, _contentManager.get(), [this](){
|
||||
_contentManager->addBackupHandler(BackupHandlerPointer(new EntitiesBackupHandler(getEntitiesFilePath(), getEntitiesReplacementFilePath())));
|
||||
_contentManager->addBackupHandler(BackupHandlerPointer(new AssetsBackupHandler(getContentBackupDir())));
|
||||
_contentManager->addBackupHandler(BackupHandlerPointer(new ContentSettingsBackupHandler(_settingsManager)));
|
||||
});
|
||||
|
||||
_contentManager->initialize(true);
|
||||
|
||||
qDebug() << "Existing backups:";
|
||||
|
@ -382,7 +386,7 @@ DomainServer::~DomainServer() {
|
|||
|
||||
if (_contentManager) {
|
||||
_contentManager->aboutToFinish();
|
||||
_contentManager->terminating();
|
||||
_contentManager->terminate();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,8 @@ void GenericThread::initialize(bool isThreaded, QThread::Priority priority) {
|
|||
_thread->setObjectName(objectName());
|
||||
|
||||
// when the worker thread is started, call our engine's run..
|
||||
|
||||
connect(_thread, &QThread::started, this, &GenericThread::started);
|
||||
connect(_thread, &QThread::started, this, &GenericThread::threadRoutine);
|
||||
connect(_thread, &QThread::finished, this, &GenericThread::finished);
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ public slots:
|
|||
void threadRoutine();
|
||||
|
||||
signals:
|
||||
void started();
|
||||
void finished();
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in a new issue