renamed GlobalPtr to GlobalPtrLock

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34981 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-07-29 11:17:28 +00:00
parent 0cc970b3db
commit 0645e2b90a
2 changed files with 5 additions and 5 deletions

View File

@@ -538,10 +538,10 @@ private:
// when working with global pointers (which is unfortunately still necessary // when working with global pointers (which is unfortunately still necessary
// sometimes, e.g. for clipboard) it is important to unlock them exactly as // sometimes, e.g. for clipboard) it is important to unlock them exactly as
// many times as we lock them which just asks for using a "smart lock" class // many times as we lock them which just asks for using a "smart lock" class
class GlobalPtr class GlobalPtrLock
{ {
public: public:
GlobalPtr(HGLOBAL hGlobal) : m_hGlobal(hGlobal) GlobalPtrLock(HGLOBAL hGlobal) : m_hGlobal(hGlobal)
{ {
m_ptr = GlobalLock(hGlobal); m_ptr = GlobalLock(hGlobal);
if ( !m_ptr ) if ( !m_ptr )
@@ -550,7 +550,7 @@ public:
} }
} }
~GlobalPtr() ~GlobalPtrLock()
{ {
if ( !GlobalUnlock(m_hGlobal) ) if ( !GlobalUnlock(m_hGlobal) )
{ {
@@ -571,7 +571,7 @@ private:
HGLOBAL m_hGlobal; HGLOBAL m_hGlobal;
void *m_ptr; void *m_ptr;
DECLARE_NO_COPY_CLASS(GlobalPtr) DECLARE_NO_COPY_CLASS(GlobalPtrLock)
}; };
// register the class when it is first needed and unregister it in dtor // register the class when it is first needed and unregister it in dtor

View File

@@ -566,7 +566,7 @@ HGLOBAL wxDIB::ConvertFromBitmap(HBITMAP hbmp)
return NULL; return NULL;
} }
if ( !ConvertFromBitmap((BITMAPINFO *)(void *)GlobalPtr(hDIB), hbmp) ) if ( !ConvertFromBitmap((BITMAPINFO *)(void *)GlobalPtrLock(hDIB), hbmp) )
{ {
// this really shouldn't happen... it worked the first time, why not // this really shouldn't happen... it worked the first time, why not
// now? // now?