From e32e0f1423c8a89b79730a246cd9e99b796659b2 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Fri, 14 May 2010 16:17:03 -0700 Subject: [PATCH] cuda.gl: add free-resource word to release interop handles --- extra/cuda/gl/gl.factor | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extra/cuda/gl/gl.factor b/extra/cuda/gl/gl.factor index 268d270e7f..2250c895e0 100644 --- a/extra/cuda/gl/gl.factor +++ b/extra/cuda/gl/gl.factor @@ -30,6 +30,10 @@ IN: cuda.gl DESTRUCTOR: unmap-resource +: free-resource ( resource -- ) + cuGraphicsUnregisterResource cuda-error ; inline + +DESTRUCTOR: free-resource + : with-mapped-resource ( ..a resource quot: ( ..a device-ptr size -- ..b ) -- ..b ) over [ map-resource ] 2dip '[ _ unmap-resource ] [ ] cleanup ; inline -