(guarantee-string string 'pango-font-description-from-string)
(let ((font (make-alien '|PangoFontDescription|))
(copy (make-alien '|PangoFontDescription|)))
- (add-gc-cleanup font (pango-font-description-cleanup copy))
+ (add-gc-cleanup font (make-pango-font-description-cleanup copy))
(C-call "pango_font_description_from_string" copy string)
(if (alien-null? copy)
(begin
(copy-alien-address! font copy)
font))))
-(define (pango-font-description-cleanup alien)
- (lambda ()
- (without-interrupts
- (lambda ()
- (if (not (alien-null? alien))
- (begin
- (C-call "pango_font_description_free" alien)
- (alien-null! alien)))))))
+(define (make-pango-font-description-cleanup alien)
+ (named-lambda (pango-font-description-cleanup)
+ ;;without-interrupts
+ (if (not (alien-null? alien))
+ (begin
+ (C-call "pango_font_description_free" alien)
+ (alien-null! alien)))))
(define (pango-font-description-free font)
(guarantee-pango-font-description font 'pango-font-description-free)
(guarantee-pango-font-description font 'pango-font-description-to-string)
(if (alien-null? font)
"<null>"
- (let ((cstr (make-alien '|char|)))
- (C-call "pango_font_description_to_string" cstr font)
- (let ((str (c-peek-cstring cstr)))
- (C-call "g_free" cstr)
- str))))
+ (without-interrupts
+ (lambda ()
+ (let ((cstr (make-alien '|char|)))
+ (C-call "pango_font_description_to_string" cstr font)
+ (let ((str (c-peek-cstring cstr)))
+ (C-call "g_free" cstr)
+ str))))))
(define-integrable (guarantee-pango-font-description object operator)
(if (not (and (alien? object)
(guarantee-pango-font-description font 'pango-context-get-metrics)
(let ((alien (make-alien '|PangoFontMetrics|))
(copy (make-alien '|PangoFontMetrics|)))
- (add-gc-cleanup alien (pango-font-metrics-cleanup copy))
+ (add-gc-cleanup alien (make-pango-font-metrics-cleanup copy))
(C-call "pango_context_get_metrics" copy context font 0)
(copy-alien-address! alien copy)
alien))
\f
;;; PangoFontMetrics
-(define (pango-font-metrics-cleanup alien)
- (lambda ()
+(define (make-pango-font-metrics-cleanup alien)
+ (named-lambda (pango-font-metrics-cleanup)
;;without-interrupts
(if (not (alien-null? alien))
(begin