From db155eee02ef6ae7d6a5d9567a1100b621a23190 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 28 Nov 2025 16:16:39 +1100 Subject: Apply rule-of-5 since painter holds a resource. --- win32/PlatWin.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/win32/PlatWin.h b/win32/PlatWin.h index 2ffc4a5fb..3db343587 100644 --- a/win32/PlatWin.h +++ b/win32/PlatWin.h @@ -81,6 +81,11 @@ struct Painter { explicit Painter(HWND hWnd_) noexcept : hWnd(hWnd_) { ::BeginPaint(hWnd, &ps); } + // Deleted so Painter objects can not be copied. + Painter(const Painter &) = delete; + Painter(Painter &&) = delete; + Painter &operator=(const Painter &) = delete; + Painter &operator=(Painter &&) = delete; ~Painter() { ::EndPaint(hWnd, &ps); } -- cgit v1.2.3