title: What happens if I call GlobalLock(), then fail to call GlobalUnlock()?
body: <p>In Win32 in order to paste data into the clipboard I have to call <code>GlobalAlloc()</code>, then <a href="http://msdn.microsoft.com/en-us/library/aa366584(VS.85).aspx" rel="noreferrer"><code>GlobalLock()</code></a> to obtain a pointer, then copy data, then call <code>GlobalUnlock()</code> and <code>SetClipboardData()</code>.</p>
  
  <p>If the code is in C++ an exception might be thrown between calls to <code>GlobalLock()</code> and <code>GlobalUnlock()</code> and if I don't take care of this <code>GlobalUnlock()</code> will not be called.</p>
  
  <p>It this a problem? What exactly happens if I call <code>GlobalLock()</code> and for whatever reason skip a pairing <code>GlobalUnlock()</code> call?</p>