Skip to content

Commit a8c2b35

Browse files
committed
Engine: Remove duplicate event loop cleanup
1 parent a0cd2ad commit a8c2b35

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
@@ -636,7 +636,6 @@ void Engine::run()
636636
{
637637
start();
638638
eventLoop(true);
639-
finalize();
640639
}
641640

642641
void Engine::runEventLoop()
@@ -777,7 +776,11 @@ void Engine::eventLoop(bool untilProjectStops)
777776
m_clock->sleep(sleepTime);
778777
}
779778

780-
finalize();
779+
m_eventLoopMutex.lock();
780+
m_threads.clear();
781+
m_running = false;
782+
m_redrawRequested = false;
783+
m_eventLoopMutex.unlock();
781784
}
782785

783786
bool Engine::isRunning() const
@@ -1962,15 +1965,6 @@ void Engine::compileMonitor(std::shared_ptr<Monitor> monitor)
19621965
#endif // USE_LLVM
19631966
}
19641967

1965-
void Engine::finalize()
1966-
{
1967-
m_eventLoopMutex.lock();
1968-
m_threads.clear();
1969-
m_running = false;
1970-
m_redrawRequested = false;
1971-
m_eventLoopMutex.unlock();
1972-
}
1973-
19741968
void Engine::deleteClones()
19751969
{
19761970
m_eventLoopMutex.lock();

src/engine/internal/engine.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ class Engine : public IEngine
206206
std::vector<std::shared_ptr<Thread>> stepThreads();
207207
void stepThread(std::shared_ptr<Thread> thread);
208208
void eventLoop(bool untilProjectStops = false);
209-
void finalize();
210209
void deleteClones();
211210
void removeExecutableClones();
212211
void addVarOrListMonitor(std::shared_ptr<Monitor> monitor, Target *target);

0 commit comments

Comments
 (0)