diff options
author | Neil <nyamatongwe@gmail.com> | 2018-04-28 10:31:25 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-04-28 10:31:25 +1000 |
commit | 9472b43539e7b4a6a3f5e657b0ec06e9e6e5eab9 (patch) | |
tree | 2486c7953942f70d46f805c5a809165c98424500 /win32/ScintillaWin.cxx | |
parent | 3173850f9261c9af83c91e92450879b233565670 (diff) | |
download | scintilla-mirror-9472b43539e7b4a6a3f5e657b0ec06e9e6e5eab9.tar.gz |
Delete standard functions on classes where there could be attempts to copy.
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r-- | win32/ScintillaWin.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 6ed96a77d..6058fedab 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -216,6 +216,11 @@ public: IMContext(HWND hwnd_) : hwnd(hwnd_), hIMC(::ImmGetContext(hwnd_)) { } + // Deleted so IMContext objects can not be copied. + IMContext(const IMContext &) = delete; + IMContext(IMContext &&) = delete; + IMContext &operator=(const IMContext &) = delete; + IMContext &operator=(IMContext &&) = delete; ~IMContext() { if (hIMC) ::ImmReleaseContext(hwnd, hIMC); @@ -283,7 +288,9 @@ class ScintillaWin : explicit ScintillaWin(HWND hwnd); // Deleted so ScintillaWin objects can not be copied. ScintillaWin(const ScintillaWin &) = delete; + ScintillaWin(ScintillaWin &&) = delete; ScintillaWin &operator=(const ScintillaWin &) = delete; + ScintillaWin &operator=(ScintillaWin &&) = delete; ~ScintillaWin() override; void Init(); @@ -2170,6 +2177,11 @@ public: ptr = ::GlobalLock(hand); } } + // Deleted so GlobalMemory objects can not be copied. + GlobalMemory(const GlobalMemory &) = delete; + GlobalMemory(GlobalMemory &&) = delete; + GlobalMemory &operator=(const GlobalMemory &) = delete; + GlobalMemory &operator=(GlobalMemory &&) = delete; ~GlobalMemory() { PLATFORM_ASSERT(!ptr); assert(!hand); |