From 3b5a0914dc2d7f76dc5bcdf3d76d7c25d8258ac0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 13 Jul 2021 23:39:03 +0100 Subject: [PATCH] Add GlobalPtr::Release() to wxMSW private header Add a unique_ptr<>-like function to this RAII HGLOBAL wrapper. This is not used yet, but will be in the upcoming commit. --- include/wx/msw/private.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index e172ea0aa6..7e0deb8b46 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -716,6 +716,14 @@ public: } } + // Give ownership of our handle to the caller. + HGLOBAL Release() + { + HGLOBAL h = m_hGlobal; + m_hGlobal = NULL; + return h; + } + // implicit conversion operator HGLOBAL() const { return m_hGlobal; }