From e7f286b87d6cc90f967b026c64d3019d2ac5f92e Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 28 Mar 2012 06:26:20 -0600 Subject: [PATCH] fix `make-handle-brush' to retain original pointer In case there's a finalizer attached to the pointer object. --- collects/racket/draw/private/brush.rkt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/collects/racket/draw/private/brush.rkt b/collects/racket/draw/private/brush.rkt index f49d9a3da0..4a9a4e3ea9 100644 --- a/collects/racket/draw/private/brush.rkt +++ b/collects/racket/draw/private/brush.rkt @@ -159,7 +159,12 @@ s) s-in)) (define b (new brush%)) - (send b set-surface-handle-info (vector s width height #f) t) + (send b set-surface-handle-info (vector s width height + ;; cache for bitmap version: + #f + ;; retain original if not copied: + (if copy? #f handle)) + t) b) (provide (protect-out surface-handle-info->bitmap))