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 | 06220b1501744c5cebc861e6e6e06449814b1d60 (patch) | |
| tree | 2580e78f4473f8f3b756462484fc5506a581dd15 /win32 | |
| parent | 774bb684b2afbf1637f7fa29e13fd901d15681d6 (diff) | |
| download | scintilla-mirror-06220b1501744c5cebc861e6e6e06449814b1d60.tar.gz | |
Backport: Delete standard functions on classes where there could be attempts to copy.
Backport of changeset 6756:29866b0927e0.
Diffstat (limited to 'win32')
| -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 b777ade12..611c9a960 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(); @@ -2159,6 +2166,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); |
