diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-05 05:10:18 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-05 05:14:20 +0200 |
commit | bcc00857a4604c874b4513bc2acc1c67d8d22c73 (patch) | |
tree | c6044ee2d28538848f48b0adb75f71908b811ca8 /Servers | |
parent | fb6dc5350df99468c73ca5ea2cbe599f95cb26fc (diff) | |
download | serenity-bcc00857a4604c874b4513bc2acc1c67d8d22c73.zip |
AK: Revert Eternal<T> for now since it doesn't work as intended.
Diffstat (limited to 'Servers')
-rw-r--r-- | Servers/WindowServer/WSClipboard.cpp | 7 | ||||
-rw-r--r-- | Servers/WindowServer/WSClipboard.h | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/Servers/WindowServer/WSClipboard.cpp b/Servers/WindowServer/WSClipboard.cpp index 4ee04992c0..7e54b168c8 100644 --- a/Servers/WindowServer/WSClipboard.cpp +++ b/Servers/WindowServer/WSClipboard.cpp @@ -1,10 +1,11 @@ #include <WindowServer/WSClipboard.h> -#include <AK/Eternal.h> WSClipboard& WSClipboard::the() { - static Eternal<WSClipboard> the; - return the; + static WSClipboard* s_the; + if (!s_the) + s_the = new WSClipboard; + return *s_the; } WSClipboard::WSClipboard() diff --git a/Servers/WindowServer/WSClipboard.h b/Servers/WindowServer/WSClipboard.h index 205b880ed9..2d22beb6f3 100644 --- a/Servers/WindowServer/WSClipboard.h +++ b/Servers/WindowServer/WSClipboard.h @@ -7,7 +7,7 @@ class WSClipboard final : public WSMessageReceiver { public: static WSClipboard& the(); - WSClipboard(); + virtual ~WSClipboard() override; bool has_data() const { @@ -21,7 +21,7 @@ public: void set_data(Retained<SharedBuffer>&&, int contents_size); private: - virtual ~WSClipboard() override; + WSClipboard(); virtual void on_message(const WSMessage&) override; RetainPtr<SharedBuffer> m_shared_buffer; |