Skip to content

Commit

Permalink
Merge pull request #203 from masajxxx/master
Browse files Browse the repository at this point in the history
Fixed missing GlobalLock in paste_windows function
  • Loading branch information
asweigart authored Oct 12, 2021
2 parents f95dd17 + b1308ad commit 3c1095f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pyperclip/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,10 @@ def paste_windows():
# (Also, it may return a handle to an empty buffer,
# but technically that's not empty)
return ""
return c_wchar_p(handle).value
locked_handle = safeGlobalLock(handle)
return_value = c_wchar_p(locked_handle).value
safeGlobalUnlock(handle)
return return_value

return copy_windows, paste_windows

Expand Down

0 comments on commit 3c1095f

Please sign in to comment.