Commit 0a2a7802 authored by luyikei's avatar luyikei

ConsoleRenderer: Don't quit the application from ConsoleRenderer

In the previous code, the app won't quit properly because it's done by a wrong thread
parent 4d542c62
......@@ -101,6 +101,7 @@ nodist_vlmc_SOURCES = \
src/Settings/Settings.moc.cpp \
src/Media/Media.moc.cpp \
src/Renderer/AbstractRenderer.moc.cpp \
src/Renderer/ConsoleRenderer.moc.cpp \
src/Project/WorkspaceWorker.moc.cpp \
src/Services/AbstractSharingService.moc.cpp \
src/Workflow/MainWorkflow.moc.cpp \
......
......@@ -212,6 +212,7 @@ VLMCCoremain( int argc, char **argv )
Project *p = Core::instance()->project();
QCoreApplication::connect( p, &Project::projectLoaded, &renderer, &ConsoleRenderer::startRender );
QCoreApplication::connect( &renderer, &ConsoleRenderer::finished, &app, &QCoreApplication::quit, Qt::QueuedConnection );
Core::instance()->settings()->load();
p->load( app.arguments()[1] );
......
......@@ -30,15 +30,12 @@
#include "Tools/VlmcDebug.h"
#include "Workflow/MainWorkflow.h"
#include <QCoreApplication>
ConsoleRenderer::ConsoleRenderer( const QString& outputFileName, QObject *parent )
: QObject( parent )
, m_outputFileName( outputFileName )
{
connect( Core::instance()->workflow(), &MainWorkflow::frameChanged,
this, &ConsoleRenderer::frameChanged, Qt::DirectConnection );
connect( Core::instance()->workflow(), &MainWorkflow::mainWorkflowEndReached, qApp, &QCoreApplication::quit );
}
void
......@@ -69,4 +66,5 @@ ConsoleRenderer::startRender()
project->nbChannels(),
project->sampleRate()
);
emit finished();
}
......@@ -40,6 +40,9 @@ private:
private:
QString m_outputFileName;
signals:
void finished();
};
#endif // CONSOLERENDERER_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment