summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Burchell <robin+git@viroteck.net>2019-05-26 17:53:03 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-05-26 18:17:40 +0200
commit8df3e2516fa416e1c778d20f7ad203d68fb6afa9 (patch)
treeab314174344dac4c3fa5a89b814249eb18290d0d
parentbb288c1baf2af79b2d98b90f419f6a0b9341b90a (diff)
downloadserenity-8df3e2516fa416e1c778d20f7ad203d68fb6afa9.zip
CEventLoop: Make it possible to determine running/quit state without using exec()
... by removing a redundant member that nothing uses (running), and exposing whether or not quit has been requested.
-rw-r--r--LibCore/CEventLoop.cpp2
-rw-r--r--LibCore/CEventLoop.h3
2 files changed, 1 insertions, 4 deletions
diff --git a/LibCore/CEventLoop.cpp b/LibCore/CEventLoop.cpp
index 755434a952..4537efb5af 100644
--- a/LibCore/CEventLoop.cpp
+++ b/LibCore/CEventLoop.cpp
@@ -87,8 +87,6 @@ private:
int CEventLoop::exec()
{
CEventLoopPusher pusher(*this);
-
- m_running = true;
for (;;) {
if (m_exit_requested)
return m_exit_code;
diff --git a/LibCore/CEventLoop.h b/LibCore/CEventLoop.h
index b39812bba0..31a0d21a48 100644
--- a/LibCore/CEventLoop.h
+++ b/LibCore/CEventLoop.h
@@ -34,7 +34,7 @@ public:
static CEventLoop& main();
static CEventLoop& current();
- bool running() const { return m_running; }
+ bool was_exit_requested() const { return m_exit_requested; }
static int register_timer(CObject&, int milliseconds, bool should_reload);
static bool unregister_timer(int timer_id);
@@ -65,7 +65,6 @@ private:
Vector<QueuedEvent, 64> m_queued_events;
- bool m_running { false };
bool m_exit_requested { false };
int m_exit_code { 0 };