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

summaryrefslogtreecommitdiff
path: root/source/game
diff options
context:
space:
mode:
Diffstat (limited to 'source/game')
-rw-r--r--source/game/StarInput.cpp5
-rw-r--r--source/game/StarInput.hpp1
2 files changed, 5 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);
diff --git a/source/game/StarInput.hpp b/source/game/StarInput.hpp
index 1746739..05b20eb 100644
--- a/source/game/StarInput.hpp
+++ b/source/game/StarInput.hpp
@@ -184,6 +184,7 @@ public:
class ClipboardUnlock {
public:
ClipboardUnlock(Input& input);
+ ClipboardUnlock(ClipboardUnlock&&);
~ClipboardUnlock();
private: