In Win32, to paste data into the clipboard, I need to call GlobalAlloc() , then GlobalLock() to get the pointer, then copy the data, then call GlobalUnlock() and SetClipboardData() .
If the code is in C ++, an exception may be GlobalLock() between calls to GlobalLock() and GlobalUnlock() , and if I do not take care of this, GlobalUnlock() will not be called.
This is problem? What exactly happens if I call GlobalLock() and for some reason miss the pairing call of GlobalUnlock() ?
memory-management windows visual-c ++ winapi
sharptooth
source share