Skip to content

Commit 615fd68

Browse files
committed
Engine: Remove duplicate event loop cleanup
1 parent 059bfd6 commit 615fd68

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

src/engine/internal/engine.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,6 @@ void Engine::run()
592592
{
593593
start();
594594
eventLoop(true);
595-
finalize();
596595
}
597596

598597
void Engine::runEventLoop()
@@ -733,7 +732,11 @@ void Engine::eventLoop(bool untilProjectStops)
733732
m_clock->sleep(sleepTime);
734733
}
735734

736-
finalize();
735+
m_eventLoopMutex.lock();
736+
m_threads.clear();
737+
m_running = false;
738+
m_redrawRequested = false;
739+
m_eventLoopMutex.unlock();
737740
}
738741

739742
bool Engine::isRunning() const
@@ -1885,15 +1888,6 @@ void Engine::compileMonitor(std::shared_ptr<Monitor> monitor)
18851888
}
18861889
}
18871890

1888-
void Engine::finalize()
1889-
{
1890-
m_eventLoopMutex.lock();
1891-
m_threads.clear();
1892-
m_running = false;
1893-
m_redrawRequested = false;
1894-
m_eventLoopMutex.unlock();
1895-
}
1896-
18971891
void Engine::deleteClones()
18981892
{
18991893
m_eventLoopMutex.lock();

src/engine/internal/engine.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ class Engine : public IEngine
201201
std::vector<std::shared_ptr<Thread>> stepThreads();
202202
void stepThread(std::shared_ptr<Thread> thread);
203203
void eventLoop(bool untilProjectStops = false);
204-
void finalize();
205204
void deleteClones();
206205
void removeExecutableClones();
207206
void addVarOrListMonitor(std::shared_ptr<Monitor> monitor, Target *target);

0 commit comments

Comments
 (0)