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.
This commit is contained in:
Vadim Zeitlin
2021-07-13 23:39:03 +01:00
parent fbedac8fa6
commit 3b5a0914dc

View File

@@ -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 // implicit conversion
operator HGLOBAL() const { return m_hGlobal; } operator HGLOBAL() const { return m_hGlobal; }