diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-04-03 16:50:08 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-04-03 16:52:25 +0200 |
commit | c02c9880b61569455eeea1dacaa15d29c33021ea (patch) | |
tree | 35580c7110f28edd9ef5b41a043f38619c0f96f1 /LibGUI/GClipboard.cpp | |
parent | 528054d192448f93789fedc3782550b3a80bee27 (diff) | |
download | serenity-c02c9880b61569455eeea1dacaa15d29c33021ea.zip |
AK: Add Eternal<T> and use it in various places.
This is useful for static locals that never need to be destroyed:
Thing& Thing::the()
{
static Eternal<Thing> the;
return the;
}
The object will be allocated in data segment memory and will never have
its destructor invoked.
Diffstat (limited to 'LibGUI/GClipboard.cpp')
-rw-r--r-- | LibGUI/GClipboard.cpp | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/LibGUI/GClipboard.cpp b/LibGUI/GClipboard.cpp index 9a349a157d..39c167cdcb 100644 --- a/LibGUI/GClipboard.cpp +++ b/LibGUI/GClipboard.cpp @@ -3,19 +3,7 @@ #include <WindowServer/WSAPITypes.h> #include <LibC/SharedBuffer.h> -GClipboard& GClipboard::the() -{ - static GClipboard* s_the; - if (!s_the) - s_the = new GClipboard; - return *s_the; -} - -GClipboard::GClipboard() -{ -} - -String GClipboard::data() const +String GClipboard::data() { WSAPI_ClientMessage request; request.type = WSAPI_ClientMessage::Type::GetClipboardContents; |