Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarInput.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/game/StarInput.cpp')
-rw-r--r--source/game/StarInput.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/game/StarInput.cpp b/source/game/StarInput.cpp
index d47045d..dec6705 100644
--- a/source/game/StarInput.cpp
+++ b/source/game/StarInput.cpp
@@ -688,7 +688,10 @@ unsigned Input::getTag(String const& tagName) const {
Input::ClipboardUnlock::ClipboardUnlock(Input& input)
: m_input(&input) { ++m_input->m_clipboardAllowed; };
-Input::ClipboardUnlock::~ClipboardUnlock() { --m_input->m_clipboardAllowed; };
+Input::ClipboardUnlock::ClipboardUnlock(ClipboardUnlock&& other) { m_input = take(other.m_input); };
+
+Input::ClipboardUnlock::~ClipboardUnlock() { if (m_input) --m_input->m_clipboardAllowed; };
+
Input::ClipboardUnlock Input::unlockClipboard() {
return Input::ClipboardUnlock(*this);