From 3b16f7a8e229a9f36ea48dee073e425ca7eadb2f Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 27 Mar 2011 11:21:28 -0600 Subject: [PATCH] win32: clipboard fix original commit: 4e7281768818743ef9c9b779affef23448dff344 --- collects/mred/private/wx/win32/clipboard.rkt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/collects/mred/private/wx/win32/clipboard.rkt b/collects/mred/private/wx/win32/clipboard.rkt index 5b212e28..e7b715f4 100644 --- a/collects/mred/private/wx/win32/clipboard.rkt +++ b/collects/mred/private/wx/win32/clipboard.rkt @@ -148,11 +148,12 @@ ;; no conversion: d])))] [all-handles (for/list ([d (in-list all-data)]) - (let ([h (GlobalAlloc GHND (bytes-length d))]) - (let ([p (GlobalLock h)]) - (memcpy p d (bytes-length d))) - (GlobalUnlock h) - h))]) + (and d + (let ([h (GlobalAlloc GHND (bytes-length d))]) + (let ([p (GlobalLock h)]) + (memcpy p d (bytes-length d))) + (GlobalUnlock h) + h)))]) (if (null? types) (drop-client c) (atomically @@ -161,7 +162,8 @@ (EmptyClipboard) (for ([t (in-list type-ids)] [h (in-list all-handles)]) - (SetClipboardData t h)) + (when h + (SetClipboardData t h))) (if (CloseClipboard) (set! client c) (drop-client c)))