From 26647f2b101c90d039ec45110de79d49edb724c9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 6 Aug 2023 16:06:26 +0200 Subject: [PATCH] LibCore: Remove the Core::Objects::all_objects() list Nobody actually used the list of all Core::Objects anyway. --- Userland/Libraries/LibCore/Object.cpp | 8 -------- Userland/Libraries/LibCore/Object.h | 5 ----- Userland/Services/WindowServer/Window.h | 1 + Userland/Shell/Shell.h | 1 + 4 files changed, 2 insertions(+), 13 deletions(-) diff --git a/Userland/Libraries/LibCore/Object.cpp b/Userland/Libraries/LibCore/Object.cpp index 684645830c..11ddf67017 100644 --- a/Userland/Libraries/LibCore/Object.cpp +++ b/Userland/Libraries/LibCore/Object.cpp @@ -15,16 +15,9 @@ namespace Core { -IntrusiveList<&Object::m_all_objects_list_node>& Object::all_objects() -{ - static IntrusiveList<&Object::m_all_objects_list_node> objects; - return objects; -} - Object::Object(Object* parent) : m_parent(parent) { - all_objects().append(*this); if (m_parent) m_parent->add_child(*this); } @@ -39,7 +32,6 @@ Object::~Object() for (auto& child : children) child->m_parent = nullptr; - all_objects().remove(*this); stop_timer(); if (m_parent) m_parent->remove_child(*this); diff --git a/Userland/Libraries/LibCore/Object.h b/Userland/Libraries/LibCore/Object.h index edc2189ca0..8c4f470162 100644 --- a/Userland/Libraries/LibCore/Object.h +++ b/Userland/Libraries/LibCore/Object.h @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -60,8 +59,6 @@ class Object AK_MAKE_NONCOPYABLE(Object); AK_MAKE_NONMOVABLE(Object); - IntrusiveListNode m_all_objects_list_node; - public: virtual ~Object(); @@ -135,8 +132,6 @@ public: void deferred_invoke(Function); - static IntrusiveList<&Object::m_all_objects_list_node>& all_objects(); - void dispatch_event(Core::Event&, Object* stay_within = nullptr); void remove_from_parent() diff --git a/Userland/Services/WindowServer/Window.h b/Userland/Services/WindowServer/Window.h index 6c0292210b..66a766aaa9 100644 --- a/Userland/Services/WindowServer/Window.h +++ b/Userland/Services/WindowServer/Window.h @@ -8,6 +8,7 @@ #include "HitTestResult.h" #include +#include #include #include #include diff --git a/Userland/Shell/Shell.h b/Userland/Shell/Shell.h index 04a2ccce8c..f7fb048549 100644 --- a/Userland/Shell/Shell.h +++ b/Userland/Shell/Shell.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include