瀏覽代碼

LibCore: Make Core::s_main_event_loop actually global

This was accidentally per-TU, as it was declared "static" in the header.
Andreas Kling 3 年之前
父節點
當前提交
3bab93c5e7
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      Userland/Libraries/LibCore/EventLoop.cpp
  2. 1 1
      Userland/Libraries/LibCore/EventLoop.h

+ 1 - 1
Userland/Libraries/LibCore/EventLoop.cpp

@@ -62,7 +62,7 @@ struct EventLoop::Private {
 };
 
 // The main event loop is global to the program, so it may be accessed from multiple threads.
-// NOTE: s_main_event_loop is not declared here as it is needed in the header.
+Threading::MutexProtected<EventLoop*> s_main_event_loop;
 static Threading::MutexProtected<NeverDestroyed<IDAllocator>> s_id_allocator;
 static Threading::MutexProtected<RefPtr<InspectorServerConnection>> s_inspector_server_connection;
 

+ 1 - 1
Userland/Libraries/LibCore/EventLoop.h

@@ -25,7 +25,7 @@
 
 namespace Core {
 
-static Threading::MutexProtected<EventLoop*> s_main_event_loop;
+extern Threading::MutexProtected<EventLoop*> s_main_event_loop;
 
 class EventLoop {
 public: