Bug fix for the bug fix. Wasn't closing the clipboard before returning. Thanks b333rt for catching this.

This commit is contained in:
Ian Thompson 2008-07-22 15:31:22 +00:00
parent 20af6c61e8
commit 6d0e840648
1 changed files with 4 additions and 2 deletions

View File

@ -917,10 +917,12 @@ GHOST_TUns8* GHOST_SystemWin32::getClipboard(int flag) const
char *buffer;
char *temp_buff;
if ( OpenClipboard(NULL) ) {
if ( IsClipboardFormatAvailable(CF_TEXT) && OpenClipboard(NULL) ) {
HANDLE hData = GetClipboardData( CF_TEXT );
if (hData == NULL)
if (hData == NULL) {
CloseClipboard();
return NULL;
}
buffer = (char*)GlobalLock( hData );
temp_buff = (char*) malloc(strlen(buffer)+1);