summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/Clipboard/Storage.cpp6
-rw-r--r--Userland/Services/Taskbar/WindowList.cpp6
2 files changed, 4 insertions, 8 deletions
diff --git a/Userland/Services/Clipboard/Storage.cpp b/Userland/Services/Clipboard/Storage.cpp
index f89f300af3..5bc7f48aaa 100644
--- a/Userland/Services/Clipboard/Storage.cpp
+++ b/Userland/Services/Clipboard/Storage.cpp
@@ -10,10 +10,8 @@ namespace Clipboard {
Storage& Storage::the()
{
- static Storage* s_the;
- if (!s_the)
- s_the = new Storage;
- return *s_the;
+ static Storage s_the;
+ return s_the;
}
Storage::Storage()
diff --git a/Userland/Services/Taskbar/WindowList.cpp b/Userland/Services/Taskbar/WindowList.cpp
index eb11240b5d..0af99bf5b0 100644
--- a/Userland/Services/Taskbar/WindowList.cpp
+++ b/Userland/Services/Taskbar/WindowList.cpp
@@ -8,10 +8,8 @@
WindowList& WindowList::the()
{
- static WindowList* s_the;
- if (!s_the)
- s_the = new WindowList;
- return *s_the;
+ static WindowList s_the;
+ return s_the;
}
Window* WindowList::find_parent(const Window& window)