In Win32 in order to paste data into the clipboard I have to call GlobalAlloc()
, then GlobalLock()
to obtain a pointer, then copy data, then call GlobalUnlock()
and SetClipboardData()
.
If the code is in C++ an exception might be thrown between calls to GlobalLock()
and GlobalUnlock()
and if I don't take care of this GlobalUnlock()
will not be called.
It this a problem? What exactly happens if I call GlobalLock()
and for whatever reason skip a pairing GlobalUnlock()
call?