Bug fix for the bug fix. Wasn't closing the clipboard before returning. Thanks b333rt...
authorIan Thompson <quornian@googlemail.com>
Tue, 22 Jul 2008 15:31:22 +0000 (15:31 +0000)
committerIan Thompson <quornian@googlemail.com>
Tue, 22 Jul 2008 15:31:22 +0000 (15:31 +0000)
intern/ghost/intern/GHOST_SystemWin32.cpp

index 0b42fb8029529fc180d916d9189bf0f6f1f7b0e9..7bc20d3873900efb007ec238ab3859a8bc8777dc 100644 (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);